Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Fix busy loops. (#3392)
Browse files Browse the repository at this point in the history
  • Loading branch information
eskimor authored Jul 1, 2021
1 parent 16f646d commit 3445eeb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions node/network/availability-recovery/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -806,8 +806,8 @@ impl AvailabilityRecoverySubsystem {
}
}
}
output = state.interactions.next() => {
if let Some((candidate_hash, result)) = output.flatten() {
output = state.interactions.select_next_some() => {
if let Some((candidate_hash, result)) = output {
state.availability_lru.put(candidate_hash, result);
}
}
Expand Down
6 changes: 2 additions & 4 deletions node/network/collator-protocol/src/validator_side/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1138,10 +1138,8 @@ pub(crate) async fn run<Context>(
_ = next_inactivity_stream.next() => {
disconnect_inactive_peers(&mut ctx, &eviction_policy, &state.peer_data).await;
}
res = state.collation_fetches.next() => {
if let Some(res) = res {
handle_collation_fetched_result(&mut ctx, &mut state, res).await;
}
res = state.collation_fetches.select_next_some() => {
handle_collation_fetched_result(&mut ctx, &mut state, res).await;
}
}

Expand Down

0 comments on commit 3445eeb

Please sign in to comment.