Skip to content

Commit

Permalink
Replace all uses of fs_err::tokio::rename with `uv_fs::rename_with_…
Browse files Browse the repository at this point in the history
…retry`

For backoff on Windows
  • Loading branch information
zanieb committed Jun 28, 2024
1 parent f3c7de3 commit a58e090
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/uv-distribution/src/source/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use uv_client::{
};
use uv_configuration::{BuildKind, PreviewMode};
use uv_extract::hash::Hasher;
use uv_fs::{write_atomic, LockedFile};
use uv_fs::{rename_with_retry, write_atomic, LockedFile};
use uv_types::{BuildContext, SourceBuildTrait};

use crate::distribution_database::ManagedClient;
Expand Down Expand Up @@ -1375,7 +1375,7 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
fs_err::tokio::create_dir_all(target.parent().expect("Cache entry to have parent"))
.await
.map_err(Error::CacheWrite)?;
fs_err::tokio::rename(extracted, &target)
rename_with_retry(extracted, &target)
.await
.map_err(Error::CacheWrite)?;

Expand Down
4 changes: 2 additions & 2 deletions crates/uv-toolchain/src/downloads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use futures::TryStreamExt;
use tokio_util::compat::FuturesAsyncReadCompatExt;
use tracing::{debug, instrument};
use url::Url;
use uv_fs::Simplified;
use uv_fs::{rename_with_retry, Simplified};

#[derive(Error, Debug)]
pub enum Error {
Expand Down Expand Up @@ -427,7 +427,7 @@ impl PythonDownload {

// Persist it to the target
debug!("Moving {} to {}", extracted.display(), path.user_display());
fs_err::tokio::rename(extracted, &path)
rename_with_retry(extracted, &path)
.await
.map_err(|err| Error::CopyError {
to: path.clone(),
Expand Down

0 comments on commit a58e090

Please sign in to comment.