mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-12 05:50:06 +00:00
integration: cancel warmup (#6494)
This commit is contained in:
parent
ac6f2e1067
commit
0483fc5539
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user