Closed aloneguid closed 5 years ago
Your container will receive a SIGTERM, so hooking in to the event .NET raises would be the equivalent. A few references: https://stackoverflow.com/questions/38291567/killing-gracefully-a-net-core-daemon-running-on-linux and https://docs.microsoft.com/en-us/dotnet/api/system.appdomain.processexit?view=netcore-2.0
Thank you, tried and works for me.
In "classic" Service Fabric services receive cancellation token request so they know they have to shutdown gracefully. Provided that all we have now is
static void Main(string[] args)
how would service gracefully shutdown?