remove unnecessary yield_nows
This commit is contained in:
parent
f9b6c2fe0c
commit
9b2f27862d
@ -52,7 +52,7 @@ use std::sync::{atomic, Arc};
|
||||
use std::time::Duration;
|
||||
use tokio::select;
|
||||
use tokio::sync::{broadcast, mpsc, oneshot, watch, Semaphore};
|
||||
use tokio::task::{yield_now, JoinHandle};
|
||||
use tokio::task::JoinHandle;
|
||||
use tokio::time::{sleep, timeout, Instant};
|
||||
use tracing::{error, info, trace, warn, Level};
|
||||
|
||||
@ -551,7 +551,6 @@ impl Web3ProxyApp {
|
||||
_ = new_top_config_receiver.changed() => {}
|
||||
}
|
||||
}
|
||||
yield_now().await;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
@ -36,7 +36,6 @@ use std::sync::atomic::AtomicU64;
|
||||
use std::sync::Arc;
|
||||
use tokio::select;
|
||||
use tokio::sync::{broadcast, mpsc, OwnedSemaphorePermit, RwLock as AsyncRwLock};
|
||||
use tokio::task::yield_now;
|
||||
use tracing::trace;
|
||||
|
||||
/// How to select backend servers for a request
|
||||
@ -550,8 +549,6 @@ async fn read_web3_socket(
|
||||
};
|
||||
|
||||
tokio::spawn(f);
|
||||
|
||||
yield_now().await;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
@ -31,7 +31,6 @@ use std::sync::atomic::Ordering;
|
||||
use std::sync::Arc;
|
||||
use tokio::select;
|
||||
use tokio::sync::{mpsc, watch};
|
||||
use tokio::task::yield_now;
|
||||
use tokio::time::{sleep_until, timeout, Duration, Instant};
|
||||
use tracing::{debug, error, info, instrument, trace, warn};
|
||||
|
||||
@ -1183,8 +1182,6 @@ impl Web3Rpcs {
|
||||
// consensus rpcs changed!
|
||||
watch_consensus_rpcs.borrow_and_update();
|
||||
|
||||
yield_now().await;
|
||||
|
||||
// continue to try again
|
||||
continue;
|
||||
}
|
||||
@ -1226,8 +1223,6 @@ impl Web3Rpcs {
|
||||
}
|
||||
}
|
||||
|
||||
yield_now().await;
|
||||
|
||||
continue;
|
||||
} else {
|
||||
warn!(?self, "all rate limits exceeded");
|
||||
|
@ -26,7 +26,6 @@ use std::hash::{Hash, Hasher};
|
||||
use std::sync::atomic::{self, AtomicU32, AtomicU64, AtomicUsize};
|
||||
use std::{cmp::Ordering, sync::Arc};
|
||||
use tokio::sync::{mpsc, watch, RwLock as AsyncRwLock};
|
||||
use tokio::task::yield_now;
|
||||
use tokio::time::{interval, sleep, sleep_until, Duration, Instant, MissedTickBehavior};
|
||||
use tracing::{debug, error, info, trace, warn, Level};
|
||||
use url::Url;
|
||||
@ -692,8 +691,6 @@ impl Web3Rpc {
|
||||
break;
|
||||
}
|
||||
|
||||
yield_now().await;
|
||||
|
||||
disconnect_watch_rx.changed().await?;
|
||||
}
|
||||
trace!("disconnect triggered on {}", rpc);
|
||||
|
Loading…
Reference in New Issue
Block a user