From f01d305c5702c9a159efd231f37da20f680ddd29 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Mon, 31 Oct 2022 21:49:34 -0400 Subject: [PATCH] explicitly pass context --- internal/cmd/scheduler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/cmd/scheduler.go b/internal/cmd/scheduler.go index c71efc2..46efdec 100644 --- a/internal/cmd/scheduler.go +++ b/internal/cmd/scheduler.go @@ -494,7 +494,7 @@ func enqueueAccounts(ctx context.Context, logger *zap.Logger, statsd *statsd.Cli wg := sync.WaitGroup{} for i := 0; i < len(ids); i += batchSize { wg.Add(1) - go func(offset int) { + go func(offset int, ctx context.Context) { defer wg.Done() ctx, cancel := context.WithCancel(ctx) @@ -523,7 +523,7 @@ func enqueueAccounts(ctx context.Context, logger *zap.Logger, statsd *statsd.Cli if err = queue.Publish(unlocked...); err != nil { logger.Error("failed to enqueue account batch", zap.Error(err)) } - }(i) + }(i, ctx) } wg.Wait()