better variable name

This commit is contained in:
Andre Medeiros 2022-05-23 18:54:38 -04:00
parent 34e050daad
commit 079cc9a5c5

View file

@ -387,7 +387,7 @@ func enqueueAccounts(ctx context.Context, logger *zap.Logger, statsd *statsd.Cli
next := now.Add(domain.NotificationCheckInterval) next := now.Add(domain.NotificationCheckInterval)
ids := make([]int64, maxNotificationChecks) ids := make([]int64, maxNotificationChecks)
numids := 0 idslen := 0
enqueued := 0 enqueued := 0
skipped := 0 skipped := 0
@ -420,7 +420,7 @@ func enqueueAccounts(ctx context.Context, logger *zap.Logger, statsd *statsd.Cli
var id int64 var id int64
_ = rows.Scan(&id) _ = rows.Scan(&id)
ids[i] = id ids[i] = id
numids = i idslen = i
} }
return nil return nil
}) })
@ -430,17 +430,17 @@ func enqueueAccounts(ctx context.Context, logger *zap.Logger, statsd *statsd.Cli
return return
} }
if numids == 0 { if idslen == 0 {
return return
} }
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))
// Split ids in batches // Split ids in batches
for i := 0; i < numids; i += batchSize { for i := 0; i < idslen; i += batchSize {
j := i + batchSize j := i + batchSize
if j > numids { if j > idslen {
j = numids j = idslen
} }
batch := Int64Slice(ids[i:j]) batch := Int64Slice(ids[i:j])