Skip to content

Commit

Permalink
Wait 20s for worker shutdown so the miner can unregister the worker
Browse files Browse the repository at this point in the history
  • Loading branch information
Shrenuj Bansal committed Aug 2, 2022
1 parent 9d65b56 commit 5f0ac7d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/lotus-worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,8 @@ var runCmd = &cli.Command{

go func() {
<-workerApi.Done()
// Wait 20s to allow the miner to unregister the worker on next heartbeat
time.Sleep(20 * time.Second)
log.Warn("Shutting down...")
if err := srv.Shutdown(context.TODO()); err != nil {
log.Errorf("shutting down RPC server failed: %s", err)
Expand Down

0 comments on commit 5f0ac7d

Please sign in to comment.