mirror of
https://github.com/kubescape/kubescape.git
synced 2026-04-15 06:58:11 +00:00
Make a second sigint terminate immediately
Right now, sending a sigint will start a graceful shutdown, which can take quite a while. By calling stop() in the signal handler it unregisters the handler so that a subsequent sigint received during a graceful shutdown will kill the process immediately. Signed-off-by: Ian Fox <code@whatthefox.dev>
This commit is contained in:
@@ -20,6 +20,8 @@ func main() {
|
||||
<-ctx.Done()
|
||||
// Perform cleanup or graceful shutdown here
|
||||
logger.L().StopError("Received interrupt signal, exiting...")
|
||||
// Clear the signal handler so that a second interrupt signal shuts down immediately
|
||||
stop()
|
||||
}()
|
||||
|
||||
if err := cmd.Execute(ctx); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user