diff options
| author | Dan Engelbrecht <[email protected]> | 2025-11-03 18:49:56 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-11-03 18:49:56 +0100 |
| commit | 7e2c0bbc566055d7d512db0c6b9709e389e1e38a (patch) | |
| tree | 2d5f0a70af823c04ca9c94442bd7c1540c137daf /src/zenremotestore/builds/buildstorageoperations.cpp | |
| parent | missing return statement in zen workspace create command (#628) (diff) | |
| download | zen-5.7.8-pre2.tar.xz zen-5.7.8-pre2.zip | |
fix clean directory and make them use effective threading where appropriate (#625)v5.7.8-pre5v5.7.8-pre3v5.7.8-pre2
fix retry logic so it does not immediately sleep if file does not exist
make sure we don't try to delete target folder files if we have already wiped it
Diffstat (limited to 'src/zenremotestore/builds/buildstorageoperations.cpp')
| -rw-r--r-- | src/zenremotestore/builds/buildstorageoperations.cpp | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/zenremotestore/builds/buildstorageoperations.cpp b/src/zenremotestore/builds/buildstorageoperations.cpp index ecf5853b8..5c1b28695 100644 --- a/src/zenremotestore/builds/buildstorageoperations.cpp +++ b/src/zenremotestore/builds/buildstorageoperations.cpp @@ -7,6 +7,7 @@ #include <zenremotestore/builds/buildstoragecache.h> #include <zenremotestore/chunking/chunkblock.h> #include <zenremotestore/chunking/chunkingcontroller.h> +#include <zenremotestore/filesystemutils.h> #include <zencore/basicfile.h> #include <zencore/compactbinary.h> @@ -19,7 +20,6 @@ #include <zencore/string.h> #include <zencore/timer.h> #include <zencore/trace.h> -#include "../filesystemutils.h" #include <numeric> @@ -2124,7 +2124,7 @@ BuildsOperationUpdateFolder::Execute(FolderContent& OutLocalFolderState) DeleteCount++; } } - else + else if (!m_Options.WipeTargetFolder) { // Delete local file as we did not scavenge the folder RemoveLocalPathIndexes.push_back(LocalPathIndex); @@ -4650,15 +4650,9 @@ BuildsOperationUploadFolder::Execute() Stopwatch ProcessTimer; + CleanAndRemoveDirectory(m_IOWorkerPool, m_AbortFlag, m_PauseFlag, m_Options.TempDir); CreateDirectories(m_Options.TempDir); - CleanDirectory(m_Options.TempDir, {}); - auto _ = MakeGuard([&]() { - if (CleanDirectory(m_Options.TempDir, {})) - { - std::error_code DummyEc; - RemoveDir(m_Options.TempDir, DummyEc); - } - }); + auto _ = MakeGuard([&]() { CleanAndRemoveDirectory(m_IOWorkerPool, m_AbortFlag, m_PauseFlag, m_Options.TempDir); }); m_LogOutput.SetLogOperationProgress(TaskSteps::PrepareBuild, TaskSteps::StepCount); @@ -6915,14 +6909,9 @@ BuildsOperationValidateBuildPart::Execute() const std::filesystem::path TempFolder = ".zen-tmp"; + CleanAndRemoveDirectory(m_IOWorkerPool, m_AbortFlag, m_PauseFlag, TempFolder); CreateDirectories(TempFolder); - auto __ = MakeGuard([&TempFolder]() { - if (CleanDirectory(TempFolder, {})) - { - std::error_code DummyEc; - RemoveDir(TempFolder, DummyEc); - } - }); + auto __ = MakeGuard([this, TempFolder]() { CleanAndRemoveDirectory(m_IOWorkerPool, m_AbortFlag, m_PauseFlag, TempFolder); }); m_LogOutput.SetLogOperationProgress(TaskSteps::ValidateBlobs, TaskSteps::StepCount); |