mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 20:11:09 +00:00
test-runtime: Add exponential backoff (#518)
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
@@ -64,7 +64,7 @@ async fn run() {
|
||||
|
||||
// Download metadata from binary; retry until successful, or a limit is hit.
|
||||
let metadata_bytes: sp_core::Bytes = {
|
||||
const MAX_RETRIES: usize = 20;
|
||||
const MAX_RETRIES: usize = 6;
|
||||
let mut retries = 0;
|
||||
|
||||
loop {
|
||||
@@ -85,7 +85,7 @@ async fn run() {
|
||||
break res
|
||||
}
|
||||
_ => {
|
||||
thread::sleep(time::Duration::from_secs(1));
|
||||
thread::sleep(time::Duration::from_secs(1 << retries));
|
||||
retries += 1;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user