Wait 20s for worker shutdown so the miner can unregister the worker

This commit is contained in:
Shrenuj Bansal 2022-08-02 10:59:32 -04:00
parent 9d65b56d2e
commit 5f0ac7defb

View File

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