diff options
Diffstat (limited to 'src/zenserver')
| -rw-r--r-- | src/zenserver/projectstore/jupiterremoteprojectstore.cpp | 51 |
1 files changed, 10 insertions, 41 deletions
diff --git a/src/zenserver/projectstore/jupiterremoteprojectstore.cpp b/src/zenserver/projectstore/jupiterremoteprojectstore.cpp index b288a667c..1508dbc3f 100644 --- a/src/zenserver/projectstore/jupiterremoteprojectstore.cpp +++ b/src/zenserver/projectstore/jupiterremoteprojectstore.cpp @@ -134,49 +134,18 @@ public: virtual HasAttachmentsResult HasAttachments(const std::span<IoHash> RawHashes) override { - CloudCacheSession Session(m_CloudClient.Get()); - const bool UseBatchRequest = - false; // The batch request API in Jupiter is currently broken so we have to resort to individual cheks - - if (UseBatchRequest) + CloudCacheSession Session(m_CloudClient.Get()); + CloudCacheExistsResult ExistsResult = Session.BlobExists(m_Namespace, std::set<IoHash>(RawHashes.begin(), RawHashes.end())); + HasAttachmentsResult Result{ConvertResult(ExistsResult), + std::unordered_set<IoHash, IoHash::Hasher>(ExistsResult.Needs.begin(), ExistsResult.Needs.end())}; + if (ExistsResult.ErrorCode) { - CloudCacheExistsResult ExistsResult = Session.BlobExists(m_Namespace, std::set<IoHash>(RawHashes.begin(), RawHashes.end())); - HasAttachmentsResult Result{ConvertResult(ExistsResult), - std::unordered_set<IoHash, IoHash::Hasher>(ExistsResult.Needs.begin(), ExistsResult.Needs.end())}; - if (ExistsResult.ErrorCode) - { - Result.Reason = fmt::format("Failed checking attachment existance in {}/{}. Reason: '{}'", - m_CloudClient->ServiceUrl(), - m_Namespace, - Result.Reason); - } - return Result; - } - else - { - Stopwatch Timer; - HasAttachmentsResult Result; - for (const IoHash& RawHash : RawHashes) - { - CloudCacheResult ExistsResult = Session.CompressedBlobExists(m_Namespace, RawHash); - if (ExistsResult.ErrorCode) - { - Result = {ConvertResult(ExistsResult)}; - Result.Reason = fmt::format("Failed checking oplog attachment existance {}/{}/{}. Reason: '{}'", - m_CloudClient->ServiceUrl(), - m_Namespace, - RawHash, - Result.Reason); - return Result; - } - if (!ExistsResult.Success) - { - Result.Needs.insert(RawHash); - } - } - Result.ElapsedSeconds = Timer.GetElapsedTimeMs() / 1000.0; - return Result; + Result.Reason = fmt::format("Failed checking attachment existance in {}/{}. Reason: '{}'", + m_CloudClient->ServiceUrl(), + m_Namespace, + Result.Reason); } + return Result; } virtual LoadAttachmentResult LoadAttachment(const IoHash& RawHash) override |