Skip to content

Commit

Permalink
Change check_for_unprocessed_data_sets query
Browse files Browse the repository at this point in the history
  • Loading branch information
maplant committed May 7, 2024
1 parent 94ce2a2 commit 65de9ab
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions mobile_verifier/src/boosting_oracles/data_sets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,19 +520,30 @@ pub mod db {
pool: &PgPool,
period_end: DateTime<Utc>,
) -> sqlx::Result<bool> {
Ok(
sqlx::query_scalar(
"SELECT COUNT(*) > 0 FROM data_sets WHERE time_to_use <= $1 AND status != 'processed'",
)
.bind(period_end)
.fetch_one(pool)
.await?
Ok(sqlx::query_scalar(
"SELECT COUNT(*) > 0 FROM data_sets WHERE time_to_use <= $1 AND status != 'processed'",
)
.bind(period_end)
.fetch_one(pool)
.await?
|| sqlx::query_scalar(
"SELECT COUNT(*) > 0 from hexes where urbanized IS NULL OR footfall IS NULL OR landtype IS NULL"
r#"
SELECT COUNT(*) > 0 FROM coverage_objects
WHERE inserted_at < $1 AND uuid IN (
SELECT
DISTINCT uuid
FROM
hexes
WHERE
urbanized IS NULL
OR footfall IS NULL
OR landtype IS NULL
)
"#,
)
.bind(period_end)
.fetch_one(pool)
.await?
)
.await?)
}
}

Expand Down

0 comments on commit 65de9ab

Please sign in to comment.