Skip to content

Commit

Permalink
Merge pull request #3925 from filecoin-project/feat/log-shutdown
Browse files Browse the repository at this point in the history
log shutdown method for lotus daemon and miner
  • Loading branch information
magik6k authored Sep 18, 2020
2 parents 7109e95 + eadc61c commit 6050401
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cmd/lotus-storage-miner/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,10 @@ var runCmd = &cli.Command{
sigChan := make(chan os.Signal, 2)
go func() {
select {
case <-sigChan:
case sig := <-sigChan:
log.Warnw("received shutdown", "signal", sig)
case <-shutdownChan:
log.Warn("received shutdown")
}

log.Warn("Shutting down...")
Expand Down
4 changes: 3 additions & 1 deletion cmd/lotus/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ func serveRPC(a api.FullNode, stop node.StopFunc, addr multiaddr.Multiaddr, shut
shutdownDone := make(chan struct{})
go func() {
select {
case <-sigCh:
case sig := <-sigCh:
log.Warnw("received shutdown", "signal", sig)
case <-shutdownCh:
log.Warn("received shutdown")
}

log.Warn("Shutting down...")
Expand Down

0 comments on commit 6050401

Please sign in to comment.