Unverified Commit 5fe8c690 authored by Benjamin Woodruff's avatar Benjamin Woodruff Committed by GitHub

Turbopack: Simplify parent directory creation retry loop logic (#95835)

Noticed while reading through the symlink code.

The symlink logic had some clever `ErrorKind::AlreadyExists` logic that
folded the retry into the main retry loop, but we still had a separate
retry loop for after handling `ErrorKind::NotFound`. This folds the
loops together.

I hand-implemented the symlink version of this and had opus port it to
the non-symlink version.
parent cc57d652
This diff is collapsed.
...@@ -54,5 +54,7 @@ pub fn can_retry(err: &io::Error) -> bool { ...@@ -54,5 +54,7 @@ pub fn can_retry(err: &io::Error) -> bool {
} }
fn get_retry_wait_time(attempt: usize) -> Duration { fn get_retry_wait_time(attempt: usize) -> Duration {
Duration::from_millis((attempt as u64) * 100) debug_assert!(attempt >= 1);
// The first retry attempt (1) is instant
Duration::from_millis((attempt - 1) as u64 * 100)
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment