Skip to content

Commit

Permalink
Avoid busy loop
Browse files Browse the repository at this point in the history
  • Loading branch information
jbearer committed Nov 18, 2024
1 parent 0c3af7c commit 251f797
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sequencer/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,9 @@ async fn fetch_proposals<N, P, V>(
if let Err(err) = res {
tracing::warn!("failed to fetch proposal: {err:#}");

// Avoid busy loop when operations are failing.
sleep(Duration::from_secs(1)).await;

// If we fail fetching the proposal, don't let it clog up the fetching task. Just push
// it back onto the queue and move onto the next proposal.
sender.broadcast_direct((view, leaf)).await.ok();
Expand Down

0 comments on commit 251f797

Please sign in to comment.