diff options
Diffstat (limited to 'zenserver/upstream/hordecompute.cpp')
| -rw-r--r-- | zenserver/upstream/hordecompute.cpp | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/zenserver/upstream/hordecompute.cpp b/zenserver/upstream/hordecompute.cpp index ca78d9160..dbf86cc13 100644 --- a/zenserver/upstream/hordecompute.cpp +++ b/zenserver/upstream/hordecompute.cpp @@ -278,9 +278,7 @@ namespace detail { } } - [[nodiscard]] CloudCacheResult BatchPutBlobsIfMissing(CloudCacheSession& Session, - const std::map<IoHash, IoBuffer>& Blobs, - const bool Force = false) + [[nodiscard]] CloudCacheResult BatchPutBlobsIfMissing(CloudCacheSession& Session, const std::map<IoHash, IoBuffer>& Blobs) { if (Blobs.size() == 0) { @@ -309,11 +307,6 @@ namespace detail { .Reason = !ExistsResult.Reason.empty() ? std::move(ExistsResult.Reason) : "Failed to check if blobs exist"}; } - if (Force) - { - ExistsResult.Needs = Keys; - } - for (const auto& Hash : ExistsResult.Needs) { CloudCacheResult Result = Session.PutBlob(Hash, Blobs.at(Hash)); @@ -332,9 +325,7 @@ namespace detail { return {.Bytes = Bytes, .ElapsedSeconds = ElapsedSeconds, .Success = true}; } - [[nodiscard]] CloudCacheResult BatchPutObjectsIfMissing(CloudCacheSession& Session, - const std::map<IoHash, CbObject>& Objects, - const bool Force = false) + [[nodiscard]] CloudCacheResult BatchPutObjectsIfMissing(CloudCacheSession& Session, const std::map<IoHash, CbObject>& Objects) { if (Objects.size() == 0) { @@ -363,11 +354,6 @@ namespace detail { .Reason = !ExistsResult.Reason.empty() ? std::move(ExistsResult.Reason) : "Failed to check if objects exist"}; } - if (Force) - { - ExistsResult.Needs = Keys; - } - for (const auto& Hash : ExistsResult.Needs) { CloudCacheResult Result = Session.PutObject(Hash, Objects.at(Hash).GetBuffer().AsIoBuffer()); @@ -539,18 +525,18 @@ namespace detail { continue; } + Timepoints["zen-complete-queue-added"] = DateTime::NowTicks(); ThreadPool.ScheduleWork([this, ApplyType, ResultHash = Status["r"sv].AsHash(), Timepoints = std::move(Timepoints), TaskId = std::move(TaskId), WorkerId = std::move(WorkerId), - ActionId = std::move(ActionId)]() { - GetUpstreamApplyResult Result = ProcessTaskStatus(ApplyType, ResultHash); - for (auto& Timepoint : Timepoints) - { - Result.Timepoints.emplace(Timepoint); - } + ActionId = std::move(ActionId)]() mutable { + Timepoints["zen-complete-queue-dispatched"] = DateTime::NowTicks(); + GetUpstreamApplyResult Result = ProcessTaskStatus(ApplyType, ResultHash); + Timepoints["zen-complete-queue-complete"] = DateTime::NowTicks(); + Result.Timepoints.merge(Timepoints); Log().debug("Task Processed {} Files={} Attachments={} ExitCode={}", TaskId, |