Skip to content

Commit c356c4f

Browse files
Backoff in worker thread on /next-crate returning empty result
1 parent ed2ffb8 commit c356c4f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/runner/worker.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ impl<'a> Worker<'a> {
160160
let krate = if let Some(next) = (self.next_crate)()? {
161161
next
162162
} else {
163+
// Backoff from calling the server again, to reduce load when we're spinning until
164+
// the next experiment is ready.
165+
std::thread::sleep(Duration::from_secs(rand::random_range(3..10)));
163166
// We're done if no more crates left.
164167
return Ok(());
165168
};

0 commit comments

Comments
 (0)