Skip to content

Commit

Permalink
sql fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andymck committed Jul 27, 2023
1 parent ee0a544 commit 506b3e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mobile_verifier/src/rewarder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl Rewarder {
}

if sqlx::query_scalar::<_, i64>(
"SELECT COUNT(*) FROM speedtests WHERE latest_timestamp >= $1",
"SELECT COUNT(*) FROM speedtests WHERE timestamp >= $1",
)
.bind(reward_period.end)
.fetch_one(&self.pool)
Expand Down Expand Up @@ -240,7 +240,7 @@ impl Rewarder {
// Clear the speedtests table of tests older than hours defined by SPEEDTEST_LAPSE
// We end up with tests older than we need here but erroring on side of caution
// and the volume of tests is low so no big impact there
sqlx::query("DELETE FROM speedtests timestamp < $1")
sqlx::query("DELETE FROM speedtests where timestamp < $1")
.bind(Utc::now() - Duration::hours(SPEEDTEST_LAPSE))
.execute(&mut transaction)
.await?;
Expand Down

0 comments on commit 506b3e5

Please sign in to comment.