From e104dda98e9101e5e09a2baa52f4f55fac250115 Mon Sep 17 00:00:00 2001 From: Schneems Date: Thu, 17 Oct 2024 09:16:23 -0500 Subject: [PATCH] Copy cache and delete instead of moving --- commons/src/cache/app_cache.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commons/src/cache/app_cache.rs b/commons/src/cache/app_cache.rs index d32859bf..cf099615 100644 --- a/commons/src/cache/app_cache.rs +++ b/commons/src/cache/app_cache.rs @@ -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 { @@ -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) }