Skip to content

Commit

Permalink
stats: it's OK to not overwrite previous count from the same day
Browse files Browse the repository at this point in the history
Addresses <#3818>.

Change-Id: I26956a40cc92ba77af14de029292a43a95a9ea9a
  • Loading branch information
vmiklos committed Mar 31, 2024
1 parent bde38be commit 33c5c51
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,11 +592,11 @@ pub fn update_invalid_addr_cities(ctx: &context::Context) -> anyhow::Result<()>
tx.execute("insert into stats_invalid_addr_cities (osm_id, osm_type, postcode, city, street, housenumber, user, timestamp, fixme) values (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9)",
[&row.osm_id, &row.osm_type, &row.postcode, &row.city, &row.street, &row.housenumber, &row.user, &row.timestamp, &row.fixme])?;
}
tx.execute(
r#"insert into stats_invalid_addr_cities_counts (date, count) values (?1, ?2)
on conflict(date) do update set count = excluded.count"#,
// Ignore errors, it's OK to not overwrite previous count from the same day.
let _ = tx.execute(
"insert into stats_invalid_addr_cities_counts (date, count) values (?1, ?2)",
[today, invalids.len().to_string()],
)?;
);
tx.commit()?;

Ok(())
Expand Down

0 comments on commit 33c5c51

Please sign in to comment.