mirror of
https://github.com/christianselig/apollo-backend
synced 2024-12-23 06:45:27 +00:00
fix float issue
This commit is contained in:
parent
69e7cfea71
commit
809b075804
1 changed files with 2 additions and 2 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 - 5
|
WHERE last_checked_at <= $1::float - 5
|
||||||
ORDER BY last_checked_at
|
ORDER BY last_checked_at
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
FOR UPDATE SKIP LOCKED`
|
FOR UPDATE SKIP LOCKED`
|
||||||
|
@ -81,7 +81,7 @@ func accountWorker(id int, rc *reddit.Client, db *sql.DB, logger *log.Logger, st
|
||||||
|
|
||||||
if account.LastCheckedAt > 0 {
|
if account.LastCheckedAt > 0 {
|
||||||
latency := now - account.LastCheckedAt - float64(backoff)
|
latency := now - account.LastCheckedAt - float64(backoff)
|
||||||
statsd.Histogram("apollo.queue.delay", float64(latency), []string{}, rate)
|
statsd.Histogram("apollo.queue.delay", latency, []string{}, rate)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = tx.Exec(`UPDATE accounts SET last_checked_at = $1 WHERE id = $2`, now, account.ID)
|
_, err = tx.Exec(`UPDATE accounts SET last_checked_at = $1 WHERE id = $2`, now, account.ID)
|
||||||
|
|
Loading…
Reference in a new issue