Replace yield_now with sleep 100 to prevent hammering a task, despite still being over-eager

This commit is contained in:
Luke Parker 2024-03-09 03:34:31 -05:00
parent 61a81e53e1
commit c93f6bf901
No known key found for this signature in database

View file

@ -836,8 +836,8 @@ async fn handle_cosigns_and_batch_publication<D: Db, P: P2p>(
) { ) {
let mut tributaries = HashMap::new(); let mut tributaries = HashMap::new();
'outer: loop { 'outer: loop {
// TODO: Create a better async flow for this, as this does still hammer this task // TODO: Create a better async flow for this
tokio::task::yield_now().await; tokio::time::sleep(core::time::Duration::from_millis(100)).await;
match tributary_event.try_recv() { match tributary_event.try_recv() {
Ok(event) => match event { Ok(event) => match event {