aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-12-15 15:19:32 +0100
committerGitHub Enterprise <[email protected]>2025-12-15 15:19:32 +0100
commit215ef33ab4a4f8deb0f08bedee5f9e7f744cebf4 (patch)
treec065f3a0c294b54f050575d73e54ff5e39b073f2 /src
parentoplog download size (#690) (diff)
downloadzen-215ef33ab4a4f8deb0f08bedee5f9e7f744cebf4.tar.xz
zen-215ef33ab4a4f8deb0f08bedee5f9e7f744cebf4.zip
remove found chunks as they are found in blocks (#691)
Diffstat (limited to 'src')
-rw-r--r--src/zenremotestore/projectstore/remoteprojectstore.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/zenremotestore/projectstore/remoteprojectstore.cpp b/src/zenremotestore/projectstore/remoteprojectstore.cpp
index 0e18cc6b0..b566e5bed 100644
--- a/src/zenremotestore/projectstore/remoteprojectstore.cpp
+++ b/src/zenremotestore/projectstore/remoteprojectstore.cpp
@@ -2830,9 +2830,12 @@ ParseOplogContainer(const CbObject& ContainerObject,
for (CbFieldView ChunkField : ChunksArray)
{
IoHash ChunkHash = ChunkField.AsBinaryAttachment();
- if (OpsAttachments.contains(ChunkHash) && !HasAttachment(ChunkHash))
+ if (OpsAttachments.erase(ChunkHash) == 1)
{
- NeededChunks.emplace_back(ChunkHash);
+ if (!HasAttachment(ChunkHash))
+ {
+ NeededChunks.emplace_back(ChunkHash);
+ }
}
}
}
@@ -2841,9 +2844,12 @@ ParseOplogContainer(const CbObject& ContainerObject,
for (CbFieldView ChunkField : ChunksArray)
{
const IoHash ChunkHash = ChunkField.AsHash();
- if (OpsAttachments.contains(ChunkHash) && !HasAttachment(ChunkHash))
+ if (OpsAttachments.erase(ChunkHash) == 1)
{
- NeededChunks.emplace_back(ChunkHash);
+ if (!HasAttachment(ChunkHash))
+ {
+ NeededChunks.emplace_back(ChunkHash);
+ }
}
}
}
@@ -2871,11 +2877,16 @@ ParseOplogContainer(const CbObject& ContainerObject,
for (CbFieldView LargeChunksField : LargeChunksArray)
{
IoHash AttachmentHash = LargeChunksField.AsBinaryAttachment();
- if (OpsAttachments.contains(AttachmentHash) && !HasAttachment(AttachmentHash))
+
+ if (OpsAttachments.erase(AttachmentHash) == 1)
{
- OnNeedAttachment(AttachmentHash);
- NeedAttachmentCount++;
+ if (!HasAttachment(AttachmentHash))
+ {
+ OnNeedAttachment(AttachmentHash);
+ NeedAttachmentCount++;
+ }
}
+
if (remotestore_impl::IsCancelled(OptionalContext))
{
return RemoteProjectStore::Result{.ErrorCode = gsl::narrow<int>(HttpResponseCode::OK),