mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-10 22:17:44 +00:00
change how we select accounts
This commit is contained in:
parent
9b73c74486
commit
827e61f3f9
1 changed files with 1 additions and 1 deletions
|
@ -64,7 +64,7 @@ func accountWorker(id int, rc *reddit.Client, db *sql.DB, logger *log.Logger, st
|
||||||
|
|
||||||
query := `
|
query := `
|
||||||
SELECT id, username, access_token, refresh_token, expires_at, last_message_id, last_checked_at FROM accounts
|
SELECT id, username, access_token, refresh_token, expires_at, last_message_id, last_checked_at FROM accounts
|
||||||
WHERE last_checked_at <= $1::float - 5
|
WHERE last_checked_at + 5 <= $1::float
|
||||||
ORDER BY last_checked_at
|
ORDER BY last_checked_at
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
FOR UPDATE SKIP LOCKED`
|
FOR UPDATE SKIP LOCKED`
|
||||||
|
|
Loading…
Reference in a new issue