From 97320023359fc443f7bc240f7e29e5312b897ee5 Mon Sep 17 00:00:00 2001 From: tsunyoku Date: Sat, 1 Jun 2024 15:56:29 +0100 Subject: [PATCH] improve mass_recalc resiliency --- src/mass_recalc/mod.rs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/mass_recalc/mod.rs b/src/mass_recalc/mod.rs index ff7f715..81308a3 100644 --- a/src/mass_recalc/mod.rs +++ b/src/mass_recalc/mod.rs @@ -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(()) } @@ -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(())