stop signals before we start the graceful stop process

This commit is contained in:
Naitik Shah 2013-10-15 11:55:48 -07:00
parent d1f693d1d4
commit 9aca7f00c4

View File

@ -144,6 +144,7 @@ func Wait(listeners []Listener) (err error) {
sig := <-ch
switch sig {
case syscall.SIGTERM:
signal.Stop(ch)
var wg sync.WaitGroup
wg.Add(len(listeners))
for _, l := range listeners {
@ -156,7 +157,6 @@ func Wait(listeners []Listener) (err error) {
}(l)
}
wg.Wait()
signal.Stop(ch)
return
case syscall.SIGUSR2:
rErr := Restart(listeners)