Skip to content

Commit

Permalink
chore: const instead of magic num in code for wait time
Browse files Browse the repository at this point in the history
  • Loading branch information
grumbach committed Nov 9, 2023
1 parent 39a7947 commit 295f3a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sn_cli/src/subcommands/files/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ use xor_name::XorName;

/// Max amount of times to retry uploading a chunk
const MAX_CHUNK_PUT_RETRIES: usize = 10;
const CHUNK_PUT_RETRY_WAIT_S: u64 = 2;

#[derive(Parser, Debug)]
pub enum FilesCmds {
Expand Down Expand Up @@ -362,7 +363,7 @@ async fn verify_and_repay_if_needed(
println!(
"Retrying chunk upload and payment verification in 2s (retry attempt {retries})"
);
tokio::time::sleep(Duration::from_secs(2)).await;
tokio::time::sleep(Duration::from_secs(CHUNK_PUT_RETRY_WAIT_S)).await;
}
retries += 1;

Expand Down

0 comments on commit 295f3a0

Please sign in to comment.