Milim commited on
Commit
af3b1cb
1 Parent(s): 23f8c48

Use non-blocking sleep function

Browse files

std::thread::sleep blocks the entire thread and thus also forces all other current requests to be halted.

Files changed (1) hide show
  1. src/results/aggregator.rs +1 -1
src/results/aggregator.rs CHANGED
@@ -74,7 +74,7 @@ pub async fn aggregate(
74
  if random_delay || !debug {
75
  let mut rng = rand::thread_rng();
76
  let delay_secs = rng.gen_range(1..10);
77
- std::thread::sleep(Duration::from_secs(delay_secs));
78
  }
79
 
80
  // fetch results from upstream search engines simultaneously/concurrently.
 
74
  if random_delay || !debug {
75
  let mut rng = rand::thread_rng();
76
  let delay_secs = rng.gen_range(1..10);
77
+ tokio::time::sleep(Duration::from_secs(delay_secs)).await;
78
  }
79
 
80
  // fetch results from upstream search engines simultaneously/concurrently.