INNER CODE UNIT · Go
setupSignalsNotification
Altinity/clickhouse-operator · cmd/operator/app/main.go:228
func setupSignalsNotification(cancel context.CancelFunc) {
stopChan := make(chan os.Signal, 2)
signal.Notify(stopChan, os.Interrupt, syscall.SIGTERM)
go func() {
<-stopChan
cancel()
<-stopChan
os.Exit(1)
}()
}