update account enqueueing logic

This commit is contained in:
Andre Medeiros 2021-07-08 20:03:56 -04:00
parent a3d9c85c1d
commit 66c4c28cb4

View file

@ -116,7 +116,8 @@ func enqueueAccounts(ctx context.Context, logger *logrus.Logger, pool *pgxpool.P
SELECT id SELECT id
FROM accounts FROM accounts
WHERE WHERE
last_checked_at + 5 < $1 last_checked_at + 5 < $1 AND
last_enqueued_at + 5 < $1
ORDER BY last_enqueued_at ORDER BY last_enqueued_at
FOR UPDATE SKIP LOCKED FOR UPDATE SKIP LOCKED
) )