prioritize by last time accounts were checked

This commit is contained in:
Andre Medeiros 2021-07-08 20:06:22 -04:00
parent 66c4c28cb4
commit 2b9da40594

View file

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