Start and shutdown
Start
On startup, our services will execute the following steps:
-
Connect to DB
Once this has been done, it will then run the following tasks in parallel, these should not block the application if they fail but essential bits of functionality might not work.
-
Set up/resume Quartz jobs
-
Register in Portal
-
Connect to RabbitMQ
Graceful shutdown
A graceful shutdown helps the application finishes ongoing tasks before it stops.
When you stop the application, it waits for a set time before shutting down. This wait time is controlled by a variable HostSettings__ShutdownTimeoutSeconds, which defaults to 30 seconds but can be changed.
Exit codes
After shutdown, the application will exit with a code to show what happened. These codes help you or support teams understand how the app stopped:
-
None (0)– The application shut down cleanly with no issues. -
Timeout (1)– Shutdown exceeded the configured timeout (e.g., 30 seconds) before tasks could finish. -
ShutdownError (2)– An error occurred while shutting down, such as a failure in resource cleanup.