Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/build_helper/src/fs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub fn recursive_remove<P: AsRef<Path>>(path: P) -> io::Result<()> {
let is_dir_like = fs::Metadata::is_dir;

const MAX_RETRIES: usize = 5;
const RETRY_DELAY_MS: u64 = 100;
const RETRY_MIN_DELAY_MS: u64 = 100;

let try_remove = || {
if is_dir_like(&metadata) {
Expand All @@ -72,7 +72,7 @@ pub fn recursive_remove<P: AsRef<Path>>(path: P) -> io::Result<()> {
Ok(()) => return Ok(()),
Err(e) if e.kind() == io::ErrorKind::NotFound => return Ok(()),
Err(_) if attempt < MAX_RETRIES - 1 => {
std::thread::sleep(std::time::Duration::from_millis(RETRY_DELAY_MS));
std::thread::sleep(std::time::Duration::from_millis(RETRY_MIN_DELAY_MS << attempt));
continue;
}
Err(e) => return Err(e),
Expand Down
Loading