diff --git a/internal/cmd/scheduler.go b/internal/cmd/scheduler.go index 17a3d7a..c71efc2 100644 --- a/internal/cmd/scheduler.go +++ b/internal/cmd/scheduler.go @@ -497,6 +497,9 @@ func enqueueAccounts(ctx context.Context, logger *zap.Logger, statsd *statsd.Cli go func(offset int) { defer wg.Done() + ctx, cancel := context.WithCancel(ctx) + defer cancel() + j := offset + batchSize if j > len(ids) { j = len(ids)