Merge pull request #3925 from filecoin-project/feat/log-shutdown

log shutdown method for lotus daemon and miner
This commit is contained in:
Łukasz Magiera 2020-09-18 23:15:41 +02:00 committed by GitHub
commit 6050401652
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -163,8 +163,10 @@ var runCmd = &cli.Command{
sigChan := make(chan os.Signal, 2) sigChan := make(chan os.Signal, 2)
go func() { go func() {
select { select {
case <-sigChan: case sig := <-sigChan:
log.Warnw("received shutdown", "signal", sig)
case <-shutdownChan: case <-shutdownChan:
log.Warn("received shutdown")
} }
log.Warn("Shutting down...") log.Warn("Shutting down...")

View File

@ -66,8 +66,10 @@ func serveRPC(a api.FullNode, stop node.StopFunc, addr multiaddr.Multiaddr, shut
shutdownDone := make(chan struct{}) shutdownDone := make(chan struct{})
go func() { go func() {
select { select {
case <-sigCh: case sig := <-sigCh:
log.Warnw("received shutdown", "signal", sig)
case <-shutdownCh: case <-shutdownCh:
log.Warn("received shutdown")
} }
log.Warn("Shutting down...") log.Warn("Shutting down...")