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
No known key found for this signature in database
GPG Key ID: 7B6881D965918214
2 changed files with 9 additions and 4 deletions

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
}
}()
}

View File

@ -496,7 +496,6 @@ out:
}
saveFileTicker.Stop()
a.saveToFile(a.filePath)
a.Logger.Info("Address handler done")
}
//----------------------------------------------------------