aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/projectstore
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-09-22 14:59:42 +0200
committerGitHub Enterprise <[email protected]>2025-09-22 14:59:42 +0200
commitca2fd94c1a6098a6b7d44c5e9882862df2cc5ce8 (patch)
tree64d13f243ad9290ca73329f325a8c7bb1a4ec9a0 /src/zenserver/projectstore
parentAdded `--oidctoken-exe-unattended` to`zen builds` and `zen oplog-download` co... (diff)
downloadzen-ca2fd94c1a6098a6b7d44c5e9882862df2cc5ce8.tar.xz
zen-ca2fd94c1a6098a6b7d44c5e9882862df2cc5ce8.zip
more responsive cancel during oplog import (#505)
- Improvement: Faster oplog import due to chunk existance check improvement - Improvement: Cancelling oplog import is now more responsive during initial phase
Diffstat (limited to 'src/zenserver/projectstore')
-rw-r--r--src/zenserver/projectstore/remoteprojectstore.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/zenserver/projectstore/remoteprojectstore.cpp b/src/zenserver/projectstore/remoteprojectstore.cpp
index 911628386..e61ccd917 100644
--- a/src/zenserver/projectstore/remoteprojectstore.cpp
+++ b/src/zenserver/projectstore/remoteprojectstore.cpp
@@ -2743,6 +2743,12 @@ ParseOplogContainer(const CbObject& ContainerObject,
NiceBytes(Chunked.RawSize),
Chunked.ChunkHashes.size());
}
+ if (remotestore_impl::IsCancelled(OptionalContext))
+ {
+ return RemoteProjectStore::Result{.ErrorCode = gsl::narrow<int>(HttpResponseCode::OK),
+ .ElapsedSeconds = Timer.GetElapsedTimeMs() / 1000.0,
+ .Reason = "Operation cancelled"};
+ }
}
size_t NeedBlockCount = 0;
@@ -2787,6 +2793,12 @@ ParseOplogContainer(const CbObject& ContainerObject,
NeedBlockCount++;
}
}
+ if (remotestore_impl::IsCancelled(OptionalContext))
+ {
+ return RemoteProjectStore::Result{.ErrorCode = gsl::narrow<int>(HttpResponseCode::OK),
+ .ElapsedSeconds = Timer.GetElapsedTimeMs() / 1000.0,
+ .Reason = "Operation cancelled"};
+ }
}
remotestore_impl::ReportMessage(OptionalContext,
fmt::format("Requesting {} of {} attachment blocks", NeedBlockCount, BlocksArray.Num()));
@@ -2801,6 +2813,12 @@ ParseOplogContainer(const CbObject& ContainerObject,
OnNeedAttachment(AttachmentHash);
NeedAttachmentCount++;
}
+ if (remotestore_impl::IsCancelled(OptionalContext))
+ {
+ return RemoteProjectStore::Result{.ErrorCode = gsl::narrow<int>(HttpResponseCode::OK),
+ .ElapsedSeconds = Timer.GetElapsedTimeMs() / 1000.0,
+ .Reason = "Operation cancelled"};
+ }
};
remotestore_impl::ReportMessage(OptionalContext,
fmt::format("Requesting {} of {} large attachments", NeedAttachmentCount, LargeChunksArray.Num()));