exit from initSighupWatcher child goroutine

also, remove excessive log message

Refs #2072
This commit is contained in:
Anton Kaliaev
2018-08-02 16:42:25 +04:00
parent 4c5a143a70
commit 8ed99c2c13
2 changed files with 9 additions and 4 deletions
+9 -3
View File
@@ -18,13 +18,19 @@ var sighupCounter int32 // For testing
func initSighupWatcher() {
sighupWatchers = newSighupWatcher()
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGHUP)
hup := make(chan os.Signal, 1)
signal.Notify(hup, syscall.SIGHUP)
quit := make(chan os.Signal, 1)
signal.Notify(quit, os.Interrupt, syscall.SIGTERM)
go func() {
for range c {
select {
case <-hup:
sighupWatchers.closeAll()
atomic.AddInt32(&sighupCounter, 1)
case <-quit:
return
}
}()
}