From 93bd3963bf338f5df3393e2860032a6458d48fec Mon Sep 17 00:00:00 2001 From: F4ilji Date: Sat, 4 Jul 2026 19:09:13 +0500 Subject: [PATCH] fix(vikon): use rename() instead of copy() for syncFiles - atomic, no extra disk space --- .../VikonIntegration/Actions/UpdateCoreAction.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Containers/VikonIntegration/Actions/UpdateCoreAction.php b/app/Containers/VikonIntegration/Actions/UpdateCoreAction.php index 0208441..c272301 100644 --- a/app/Containers/VikonIntegration/Actions/UpdateCoreAction.php +++ b/app/Containers/VikonIntegration/Actions/UpdateCoreAction.php @@ -119,10 +119,10 @@ class UpdateCoreAction if (File::exists($targetPath)) { $oldPath = $targetPath . self::OLD_SUFFIX; - File::delete($oldPath); + @unlink($oldPath); rename($targetPath, $oldPath); } - copy($file->getPathname(), $targetPath); + rename($file->getPathname(), $targetPath); } foreach (File::directories($source) as $dir) { @@ -131,11 +131,11 @@ class UpdateCoreAction if (File::exists($targetPath)) { $oldPath = $targetPath . self::OLD_SUFFIX; - File::deleteDirectory($oldPath); - File::move($targetPath, $oldPath); + $this->fs->safeRemove($oldPath, $target, true); + rename($targetPath, $oldPath); } - File::copyDirectory($dir, $targetPath); + rename($dir, $targetPath); } }