This commit is contained in:
Andre Medeiros 2021-07-08 20:17:20 -04:00
parent 4719ee091e
commit c1f1d2a309

View file

@ -149,17 +149,19 @@ func enqueueAccounts(ctx context.Context, logger *logrus.Logger, pool *pgxpool.P
"count": len(ids), "count": len(ids),
}).Debug("enqueueing account batch") }).Debug("enqueueing account batch")
enqueued := 0
for _, id := range ids { for _, id := range ids {
payload := fmt.Sprintf("%d", id) payload := fmt.Sprintf("%d", id)
if redisConn.HGet(ctx, "locks:accounts", payload).Val() != "" { if redisConn.HGet(ctx, "locks:accounts", payload).Val() != "" {
continue continue
} }
enqueued++
_ = queue.Publish(payload) _ = queue.Publish(payload)
} }
logger.WithFields(logrus.Fields{ logger.WithFields(logrus.Fields{
"count": len(ids), "count": enqueued,
}).Debug("done enqueueing account batch") }).Info("done enqueueing account batch")
} }
func logErrors(errChan <-chan error) { func logErrors(errChan <-chan error) {