Browse Source

exit from initSighupWatcher child goroutine

also, remove excessive log message

Refs #2072
pull/2135/head
Anton Kaliaev 6 years ago
parent
commit
8ed99c2c13
No known key found for this signature in database GPG Key ID: 7B6881D965918214
2 changed files with 9 additions and 4 deletions
  1. +9
    -3
      libs/autofile/sighup_watcher.go
  2. +0
    -1
      p2p/pex/addrbook.go

+ 9
- 3
libs/autofile/sighup_watcher.go 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
}
}()
}


+ 0
- 1
p2p/pex/addrbook.go View File

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


Loading…
Cancel
Save