diff --git a/core/rawdb/rawdbreset/reset_stages.go b/core/rawdb/rawdbreset/reset_stages.go index 954a53e1d..347b67d41 100644 --- a/core/rawdb/rawdbreset/reset_stages.go +++ b/core/rawdb/rawdbreset/reset_stages.go @@ -229,8 +229,6 @@ func WarmupTable(ctx context.Context, db kv.RoDB, bucket string, lvl log.Lvl) { logEvery := time.NewTicker(20 * time.Second) defer logEvery.Stop() - //0000000000a8a7b800000044 - g, ctx := errgroup.WithContext(ctx) g.SetLimit(ThreadsLimit) for i := 0; i < 256; i++ { @@ -248,7 +246,10 @@ func WarmupTable(ctx context.Context, db kv.RoDB, bucket string, lvl log.Lvl) { if err != nil { return err } + progress.Inc() select { + case <-ctx.Done(): + return ctx.Err() case <-logEvery.C: log.Log(lvl, fmt.Sprintf("Progress: %s %.2f%%", bucket, 100*float64(progress.Load())/float64(total))) default: @@ -275,6 +276,8 @@ func WarmupTable(ctx context.Context, db kv.RoDB, bucket string, lvl log.Lvl) { return err } select { + case <-ctx.Done(): + return ctx.Err() case <-logEvery.C: log.Log(lvl, fmt.Sprintf("Progress: %s %.2f%%", bucket, 100*float64(progress.Load())/float64(total))) default: