diff --git a/libs/autofile/sighup_watcher.go b/libs/autofile/sighup_watcher.go index 56fbd4d86..f72f12fcd 100644 --- a/libs/autofile/sighup_watcher.go +++ b/libs/autofile/sighup_watcher.go @@ -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 } }() } diff --git a/p2p/pex/addrbook.go b/p2p/pex/addrbook.go index ef7d7edaa..9596b1d76 100644 --- a/p2p/pex/addrbook.go +++ b/p2p/pex/addrbook.go @@ -496,7 +496,6 @@ out: } saveFileTicker.Stop() a.saveToFile(a.filePath) - a.Logger.Info("Address handler done") } //----------------------------------------------------------