Skip to content

Commit

Permalink
invalidate old bans if processing new ban
Browse files Browse the repository at this point in the history
  • Loading branch information
bbalser committed Jul 9, 2024
1 parent f190783 commit d2c4bfd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions mobile_verifier/src/sp_boosted_rewards_bans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ pub mod db {
) -> anyhow::Result<BannedRadios> {
sqlx::query(
r#"
SELECT radio_type, radio_key
SELECT distinct radio_type, radio_key
FROM sp_boosted_rewards_bans
WHERE received_timestamp <= $1
AND until > $1
Expand Down Expand Up @@ -365,7 +365,10 @@ pub mod db {
SpBoostedRewardsBannedRadioReason::Unbanned => {
invalidate_all_before(transaction, report).await
}
_ => save(transaction, report).await,
_ => {
invalidate_all_before(transaction, report).await?;
save(transaction, report).await
}
}
}

Expand Down

0 comments on commit d2c4bfd

Please sign in to comment.