Skip to content

Commit

Permalink
improve mass_recalc resiliency
Browse files Browse the repository at this point in the history
  • Loading branch information
tsunyoku committed Jun 1, 2024
1 parent 4bb4e01 commit 9732002
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/mass_recalc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ async fn queue_user(user_id: i32, rework: &Rework, context: &Context) -> anyhow:
)
.await?;

log::info!(
user_id = user_id;
"Queued user",
);
Ok(())
}

Expand Down Expand Up @@ -140,7 +136,20 @@ pub async fn serve(context: Context) -> anyhow::Result<()> {
.await?;

for (user_id,) in user_ids {
queue_user(user_id, &rework, &context).await?;
match queue_user(user_id, &rework, &context).await {
Ok(()) => log::info!(
user_id = user_id;
"Queued user",
),
Err(err) => {
let err_str = err.to_string();
log::info!(
user_id = user_id,
err = err_str;
"Failed to queue user"
)
}
}
}

Ok(())
Expand Down

0 comments on commit 9732002

Please sign in to comment.