mirror of
https://github.com/neon-mmd/websurfx.git
synced 2024-11-21 21:48:21 -05:00
Use non-blocking sleep function
std:🧵:sleep blocks the entire thread and thus also forces all other current requests to be halted.
This commit is contained in:
parent
23f8c482dc
commit
af3b1cb308
@ -74,7 +74,7 @@ pub async fn aggregate(
|
||||
if random_delay || !debug {
|
||||
let mut rng = rand::thread_rng();
|
||||
let delay_secs = rng.gen_range(1..10);
|
||||
std::thread::sleep(Duration::from_secs(delay_secs));
|
||||
tokio::time::sleep(Duration::from_secs(delay_secs)).await;
|
||||
}
|
||||
|
||||
// fetch results from upstream search engines simultaneously/concurrently.
|
||||
|
Loading…
Reference in New Issue
Block a user