move another yield_now

This commit is contained in:
Bryan Stitt 2023-09-18 23:42:54 -07:00
parent fc287d24ea
commit 41314df25b

@ -598,10 +598,14 @@ impl Web3Rpcs {
if start.elapsed() > max_wait { if start.elapsed() > max_wait {
break; break;
} }
// TODO: i don't see how we can get here. something feels wrong if this is common.
// maybe from a race? maybe _best_available_rpc returned NotReady just as a node synced
yield_now().await;
} }
ShouldWaitForBlock::Wait { .. } => select! { ShouldWaitForBlock::Wait { .. } => select! {
_ = watch_ranked_rpcs.changed() => { _ = watch_ranked_rpcs.changed() => {
// no need to borrow_and_update because we do that at the top of the loop // no need to borrow_and_update because we do that at the top of the loop
// TODO: wait until watched_ranked_rpcs is on the right block?
trace!("watch ranked rpcs changed"); trace!("watch ranked rpcs changed");
}, },
_ = sleep_until(start + max_wait) => break, _ = sleep_until(start + max_wait) => break,
@ -624,8 +628,6 @@ impl Web3Rpcs {
break; break;
} }
yield_now().await;
// clear for the next loop // clear for the next loop
potential_rpcs.clear(); potential_rpcs.clear();
} }
@ -1127,7 +1129,7 @@ impl Web3Rpcs {
let rpc = x.clone_connection(); let rpc = x.clone_connection();
if !rpc.backup { if !rpc.backup {
// TODO: its possible we serve from a synced connection though. think about this more // TODO: even if a backup is included, it is possible the response is still from a primary connection. think about this more
only_backups_used = false; only_backups_used = false;
} }