Skip to content

Commit aa9b32b

Browse files
committed
fix: simplify rav_requester_finalize error handling
Signed-off-by: Alexis Asseman <[email protected]>
1 parent 5c910ed commit aa9b32b

File tree

1 file changed

+25
-26
lines changed

1 file changed

+25
-26
lines changed

tap-agent/src/tap/sender_account.rs

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -237,33 +237,32 @@ impl SenderAccount {
237237
.collect::<Vec<_>>();
238238

239239
for allocation in allocations_finalizing {
240-
match allocation.rav_requester_single().await {
241-
Ok(_) => {
242-
if let Err(e) = allocation.mark_rav_final().await {
243-
error!(
244-
"Error while marking allocation {} as final for sender {}: {}",
245-
allocation.get_allocation_id(),
246-
inner.sender,
247-
e
248-
);
249-
}
250-
251-
// Remove the allocation from the finalizing map.
252-
inner
253-
.allocations_ineligible
254-
.lock()
255-
.await
256-
.remove(&allocation.get_allocation_id());
257-
}
258-
Err(e) => {
259-
error!(
260-
"Error while requesting final RAV for sender {} and allocation {}: {}",
261-
inner.sender,
262-
allocation.get_allocation_id(),
263-
e
264-
)
265-
}
240+
if let Err(e) = allocation.rav_requester_single().await {
241+
error!(
242+
"Error while requesting RAV for sender {} and allocation {}: {}",
243+
inner.sender,
244+
allocation.get_allocation_id(),
245+
e
246+
);
247+
continue;
248+
}
249+
250+
if let Err(e) = allocation.mark_rav_final().await {
251+
error!(
252+
"Error while marking allocation {} as final for sender {}: {}",
253+
allocation.get_allocation_id(),
254+
inner.sender,
255+
e
256+
);
257+
continue;
266258
}
259+
260+
// Remove the allocation from the finalizing map.
261+
inner
262+
.allocations_ineligible
263+
.lock()
264+
.await
265+
.remove(&allocation.get_allocation_id());
267266
}
268267
}
269268
}

0 commit comments

Comments
 (0)