mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-14 16:07:42 +00:00
better iteration
This commit is contained in:
parent
084407a5f2
commit
d243cebab6
1 changed files with 2 additions and 4 deletions
|
@ -442,12 +442,10 @@ func enqueueAccounts(ctx context.Context, logger *zap.Logger, statsd *statsd.Cli
|
||||||
|
|
||||||
logger.Debug("enqueueing account batch", zap.Int("count", len(ids)), zap.Time("start", now))
|
logger.Debug("enqueueing account batch", zap.Int("count", len(ids)), zap.Time("start", now))
|
||||||
|
|
||||||
batches := (idslen / batchSize) + 1
|
|
||||||
wg := sync.WaitGroup{}
|
|
||||||
wg.Add(batches)
|
|
||||||
|
|
||||||
// Split ids in batches
|
// Split ids in batches
|
||||||
|
wg := sync.WaitGroup{}
|
||||||
for i := 0; i < idslen; i += batchSize {
|
for i := 0; i < idslen; i += batchSize {
|
||||||
|
wg.Add(1)
|
||||||
go func(offset int) {
|
go func(offset int) {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue