From 5f0ac7defb9f53d056ac0d0a895b58b9d7bf6508 Mon Sep 17 00:00:00 2001 From: Shrenuj Bansal Date: Tue, 2 Aug 2022 10:59:32 -0400 Subject: [PATCH] Wait 20s for worker shutdown so the miner can unregister the worker --- cmd/lotus-worker/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/lotus-worker/main.go b/cmd/lotus-worker/main.go index 56555c152..f254943e3 100644 --- a/cmd/lotus-worker/main.go +++ b/cmd/lotus-worker/main.go @@ -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)