From 54a33f2ab5935c05a2ba9378d4ee2dc28acefeb0 Mon Sep 17 00:00:00 2001 From: Kirill Fomichev Date: Mon, 18 Sep 2023 11:29:14 +0400 Subject: [PATCH] replace yield_now by sleep --- yellowstone-grpc-geyser/src/grpc.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/yellowstone-grpc-geyser/src/grpc.rs b/yellowstone-grpc-geyser/src/grpc.rs index 5c5e2593..31bf30f3 100644 --- a/yellowstone-grpc-geyser/src/grpc.rs +++ b/yellowstone-grpc-geyser/src/grpc.rs @@ -38,7 +38,6 @@ use { }, tokio::{ sync::{broadcast, mpsc, Mutex, Notify, RwLock, Semaphore}, - task::yield_now, time::{sleep, Duration, Instant}, }, tokio_stream::wrappers::ReceiverStream, @@ -1070,7 +1069,7 @@ impl GrpcService { } } Err(crossbeam_channel::TryRecvError::Empty) => { - yield_now().await; + sleep(Duration::from_millis(1)).await; continue; } Err(crossbeam_channel::TryRecvError::Disconnected) => {