From aa9b32b7692649a648fcec2dc2b36e6feeed2122 Mon Sep 17 00:00:00 2001 From: Alexis Asseman Date: Thu, 1 Feb 2024 16:24:44 -0800 Subject: [PATCH] fix: simplify rav_requester_finalize error handling Signed-off-by: Alexis Asseman --- tap-agent/src/tap/sender_account.rs | 51 ++++++++++++++--------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/tap-agent/src/tap/sender_account.rs b/tap-agent/src/tap/sender_account.rs index bb6b795ff..2f701b174 100644 --- a/tap-agent/src/tap/sender_account.rs +++ b/tap-agent/src/tap/sender_account.rs @@ -237,33 +237,32 @@ impl SenderAccount { .collect::>(); for allocation in allocations_finalizing { - match allocation.rav_requester_single().await { - Ok(_) => { - if let Err(e) = allocation.mark_rav_final().await { - error!( - "Error while marking allocation {} as final for sender {}: {}", - allocation.get_allocation_id(), - inner.sender, - e - ); - } - - // Remove the allocation from the finalizing map. - inner - .allocations_ineligible - .lock() - .await - .remove(&allocation.get_allocation_id()); - } - Err(e) => { - error!( - "Error while requesting final RAV for sender {} and allocation {}: {}", - inner.sender, - allocation.get_allocation_id(), - e - ) - } + if let Err(e) = allocation.rav_requester_single().await { + error!( + "Error while requesting RAV for sender {} and allocation {}: {}", + inner.sender, + allocation.get_allocation_id(), + e + ); + continue; + } + + if let Err(e) = allocation.mark_rav_final().await { + error!( + "Error while marking allocation {} as final for sender {}: {}", + allocation.get_allocation_id(), + inner.sender, + e + ); + continue; } + + // Remove the allocation from the finalizing map. + inner + .allocations_ineligible + .lock() + .await + .remove(&allocation.get_allocation_id()); } } }