Skip to content

Commit

Permalink
fix: simplify rav_requester_finalize error handling
Browse files Browse the repository at this point in the history
Signed-off-by: Alexis Asseman <[email protected]>
  • Loading branch information
aasseman committed Feb 2, 2024
1 parent 5c910ed commit aa9b32b
Showing 1 changed file with 25 additions and 26 deletions.
51 changes: 25 additions & 26 deletions tap-agent/src/tap/sender_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,33 +237,32 @@ impl SenderAccount {
.collect::<Vec<_>>();

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());
}
}
}
Expand Down

0 comments on commit aa9b32b

Please sign in to comment.