parallel warmup to exit early if nil

This commit is contained in:
alex.sharov 2023-01-10 09:57:52 +07:00
parent 7c2ed8e01f
commit 89f8a43509

View File

@ -307,6 +307,9 @@ func parallelTransform(ctx context.Context, in chan pair, out chan pair, transfo
}
func parallelWarmup(ctx context.Context, db kv.RoDB, bucket string, workers int) error {
if db == nil || ctx == nil || workers == 0 {
return nil
}
g, ctx := errgroup.WithContext(ctx)
g.SetLimit(workers)
for i := 0; i < 256; i++ {