Skip to content

Commit

Permalink
Keep last 10
Browse files Browse the repository at this point in the history
  • Loading branch information
macpie committed Nov 12, 2024
1 parent fba2fda commit 2399aa6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mobile_verifier/src/coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ pub async fn clear_coverage_objects(
.execute(&mut *tx)
.await?;

// Delete all but the latest valid coverage_objects entry per radio_key before a given timestamp
// Delete all but the last 10 valid coverage_objects entry per radio_key before a given timestamp
sqlx::query(
r#"
WITH orphan_coverage_objects AS (
Expand All @@ -509,7 +509,7 @@ pub async fn clear_coverage_objects(
WHERE
invalidated_at IS NULL AND inserted_at < $1
) AS ranked_rows
WHERE row_num > 1
WHERE row_num > 10
)
DELETE FROM coverage_objects
USING orphan_coverage_objects
Expand Down

0 comments on commit 2399aa6

Please sign in to comment.