one context per goroutine

This commit is contained in:
Andre Medeiros 2022-10-31 21:48:47 -04:00
parent eb1d904f86
commit d9f7689d27

View file

@ -497,6 +497,9 @@ func enqueueAccounts(ctx context.Context, logger *zap.Logger, statsd *statsd.Cli
go func(offset int) { go func(offset int) {
defer wg.Done() defer wg.Done()
ctx, cancel := context.WithCancel(ctx)
defer cancel()
j := offset + batchSize j := offset + batchSize
if j > len(ids) { if j > len(ids) {
j = len(ids) j = len(ids)