diff --git a/src/main.rs b/src/main.rs index 8eee7dc..3ba0414 100644 --- a/src/main.rs +++ b/src/main.rs @@ -233,9 +233,9 @@ async fn check_repo(client: &s3::Client, state: &mut State, repo: &str) -> eyre: if alert { println!("Sending alert to {} about bucket {}", config.email, repo); send_email(&config.email, repo, inactivity).await?; + state.update_last_alert(repo); + write_state(client, state).await?; } - state.update_last_alert(repo); - write_state(client, state).await?; Ok(Some(AlertStatus { alert, inactivity, last_alert })) } else { Ok(None)