From c93f6bf901ec98510606b0d324a44fa2cc4d56bd Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Sat, 9 Mar 2024 03:34:31 -0500 Subject: [PATCH] Replace yield_now with sleep 100 to prevent hammering a task, despite still being over-eager --- coordinator/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coordinator/src/main.rs b/coordinator/src/main.rs index 690fb342..4de23ae0 100644 --- a/coordinator/src/main.rs +++ b/coordinator/src/main.rs @@ -836,8 +836,8 @@ async fn handle_cosigns_and_batch_publication( ) { let mut tributaries = HashMap::new(); 'outer: loop { - // TODO: Create a better async flow for this, as this does still hammer this task - tokio::task::yield_now().await; + // TODO: Create a better async flow for this + tokio::time::sleep(core::time::Duration::from_millis(100)).await; match tributary_event.try_recv() { Ok(event) => match event {