Skip to content

Commit

Permalink
Copy cache and delete instead of moving
Browse files Browse the repository at this point in the history
  • Loading branch information
schneems committed Oct 17, 2024
1 parent 92f1262 commit e104dda
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion commons/src/cache/app_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl AppCache {
fs_err::create_dir_all(&self.path).map_err(CacheError::IoError)?;
fs_err::create_dir_all(&self.cache).map_err(CacheError::IoError)?;

fs_extra::dir::move_dir(
fs_extra::dir::copy(
&self.cache,
&self.path,
&CopyOptions {
Expand All @@ -170,6 +170,8 @@ impl AppCache {
})?;
copy_mtime_r(&self.cache, &self.path)?;

fs_err::remove_dir_all(&self.cache).map_err(CacheError::IoError)?;

Ok(self)
}

Expand Down

0 comments on commit e104dda

Please sign in to comment.