|
|
|
@ -52,10 +52,10 @@ func WrapUp() {
|
|
|
|
|
wrapUpListeners.notifyListeners()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func gracefulStop(signals chan os.Signal) {
|
|
|
|
|
func gracefulStop(signals chan os.Signal, sig syscall.Signal) {
|
|
|
|
|
signal.Stop(signals)
|
|
|
|
|
|
|
|
|
|
logx.Info("Got signal SIGTERM, shutting down...")
|
|
|
|
|
logx.Infof("Got signal %d, shutting down...", sig)
|
|
|
|
|
go wrapUpListeners.notifyListeners()
|
|
|
|
|
|
|
|
|
|
time.Sleep(wrapUpTime)
|
|
|
|
@ -63,7 +63,7 @@ func gracefulStop(signals chan os.Signal) {
|
|
|
|
|
|
|
|
|
|
time.Sleep(delayTimeBeforeForceQuit - wrapUpTime)
|
|
|
|
|
logx.Infof("Still alive after %v, going to force kill the process...", delayTimeBeforeForceQuit)
|
|
|
|
|
syscall.Kill(syscall.Getpid(), syscall.SIGTERM)
|
|
|
|
|
_ = syscall.Kill(syscall.Getpid(), sig)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type listenerManager struct {
|
|
|
|
|