[cmds] Trigger instance shutdown on external events

This commit is contained in:
Vladimir Stoilov 2025-03-12 15:07:54 +02:00
parent 260449e59b
commit 3b5556b7bb
No known key found for this signature in database

View file

@ -123,9 +123,13 @@ waitSignal:
}
}
// Wait for shutdown to finish.
// Trigger shutdown.
s.instance.Shutdown()
// Notify the service host that service is in shutting down state.
changes <- svc.Status{State: svc.StopPending}
// Wait for shutdown to finish.
// Catch signals during shutdown.
// Force exit after 5 interrupts.
forceCnt := 5