From edefaa437f136479774e556f4d429d653198a0b1 Mon Sep 17 00:00:00 2001 From: segfaultdoctor Date: Thu, 2 Jun 2022 02:49:51 -0400 Subject: [PATCH] use tokio sleep inside async (#25680) Co-authored-by: Zano --- client/src/http_sender.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/http_sender.rs b/client/src/http_sender.rs index 19c710b24..66d68e138 100644 --- a/client/src/http_sender.rs +++ b/client/src/http_sender.rs @@ -20,9 +20,9 @@ use { atomic::{AtomicU64, Ordering}, Arc, RwLock, }, - thread::sleep, time::{Duration, Instant}, }, + tokio::time::sleep, }; pub struct HttpSender { @@ -147,7 +147,7 @@ impl RpcSender for HttpSender { response, too_many_requests_retries, duration ); - sleep(duration); + sleep(duration).await; stats_updater.add_rate_limited_time(duration); continue; }