We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d661bde + a7abedd commit 489e8cbCopy full SHA for 489e8cb
src/agent/api.rs
@@ -6,6 +6,7 @@ use crate::results::TestResult;
6
use crate::server::api_types::{AgentConfig, ApiResponse, CraterToken};
7
use crate::toolchain::Toolchain;
8
use crate::utils;
9
+use rand::Rng;
10
use reqwest::blocking::RequestBuilder;
11
use reqwest::header::AUTHORIZATION;
12
use reqwest::{Method, StatusCode};
@@ -104,7 +105,9 @@ impl AgentApi {
104
105
106
if retry {
107
warn!("connection to the server failed. retrying in a few seconds...");
- ::std::thread::sleep(::std::time::Duration::from_secs(RETRY_AFTER));
108
+ ::std::thread::sleep(::std::time::Duration::from_millis(
109
+ rand::thread_rng().gen_range(0..(RETRY_AFTER * 1000)),
110
+ ));
111
continue;
112
}
113
0 commit comments