diff options
| author | Dan Engelbrecht <[email protected]> | 2026-02-06 12:43:15 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-02-06 12:43:15 +0100 |
| commit | f970ee291283a4f0ce8e2c0adfc77caefc30d829 (patch) | |
| tree | 9b0d796bcf8422c6cec53cde3ffa7d5c9c0ade99 /src | |
| parent | only check file size for requested range in asio TransmitFileAsync in debug m... (diff) | |
| download | zen-f970ee291283a4f0ce8e2c0adfc77caefc30d829.tar.xz zen-f970ee291283a4f0ce8e2c0adfc77caefc30d829.zip | |
fix target folder cleanup in builds download (#746)
Diffstat (limited to 'src')
| -rw-r--r-- | src/zenremotestore/builds/buildstorageoperations.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/zenremotestore/builds/buildstorageoperations.cpp b/src/zenremotestore/builds/buildstorageoperations.cpp index 26968efc1..2319ad66d 100644 --- a/src/zenremotestore/builds/buildstorageoperations.cpp +++ b/src/zenremotestore/builds/buildstorageoperations.cpp @@ -1969,13 +1969,14 @@ BuildsOperationUpdateFolder::Execute(FolderContent& OutLocalFolderState) { if (!m_Options.WipeTargetFolder) { + // Check if it is already in the correct place if (auto RemotePathIt = RemotePathToRemoteIndex.find(LocalPath.generic_string()); RemotePathIt != RemotePathToRemoteIndex.end()) { const uint32_t RemotePathIndex = RemotePathIt->second; if (m_RemoteContent.RawHashes[RemotePathIndex] == RawHash) { - // It is already in it's desired place + // It is already in it's correct place RemotePathIndexToLocalPathIndex[RemotePathIndex] = LocalPathIndex; SequenceHashToLocalPathIndex.insert({RawHash, LocalPathIndex}); MatchCount++; @@ -1991,31 +1992,27 @@ BuildsOperationUpdateFolder::Execute(FolderContent& OutLocalFolderState) PathMismatchCount++; } } + + // Do we need it? if (m_RemoteLookup.RawHashToSequenceIndex.contains(RawHash)) { if (!CachedRemoteSequences.contains(RawHash)) { - ZEN_TRACE_CPU("MoveToCache"); - // We need it + // We need it, make sure we move it to the cache FilesToCache.push_back(LocalPathIndex); CachedRemoteSequences.insert(RawHash); + continue; } else { - // We already have it SkippedCount++; } } - else if (!m_Options.WipeTargetFolder) - { - // We don't need it - RemoveLocalPathIndexes.push_back(LocalPathIndex); - DeleteCount++; - } } - else if (!m_Options.WipeTargetFolder) + + if (!m_Options.WipeTargetFolder) { - // Delete local file as we did not scavenge the folder + // Explicitly delete the unneeded local file RemoveLocalPathIndexes.push_back(LocalPathIndex); DeleteCount++; } |