From 2b9da40594c68e26eaecac05b9bf1a7e9d4223c5 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Thu, 8 Jul 2021 20:06:22 -0400 Subject: [PATCH] prioritize by last time accounts were checked --- cmd/apollo-scheduler/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/apollo-scheduler/main.go b/cmd/apollo-scheduler/main.go index 5f39990..7a716ee 100644 --- a/cmd/apollo-scheduler/main.go +++ b/cmd/apollo-scheduler/main.go @@ -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