From 9aeaee2aa3a351e4be85f9c6cfa08cde66283897 Mon Sep 17 00:00:00 2001 From: zousar Date: Thu, 14 Aug 2025 16:48:36 -0600 Subject: Ensure that FinalizeContainer finalizes both part and build --- .../projectstore/buildsremoteprojectstore.cpp | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/zenserver/projectstore/buildsremoteprojectstore.cpp b/src/zenserver/projectstore/buildsremoteprojectstore.cpp index c9a01e56a..52cdc5983 100644 --- a/src/zenserver/projectstore/buildsremoteprojectstore.cpp +++ b/src/zenserver/projectstore/buildsremoteprojectstore.cpp @@ -270,6 +270,37 @@ public: m_OplogBuildPartId, Ex.what()); } + + if (!Result.ErrorCode && Result.Needs.empty()) + { + try + { + m_BuildStorage->FinalizeBuild(m_BuildId); + } + catch (const HttpClientError& Ex) + { + Result.ErrorCode = Ex.m_Error != 0 ? Ex.m_Error + : Ex.m_ResponseCode != HttpResponseCode::ImATeapot ? (int)Ex.m_ResponseCode + : 0; + Result.Reason = fmt::format("Failed finalizing oplog container build to {}/{}/{}/{}. Reason: '{}'", + m_Url, + m_Namespace, + m_Bucket, + m_BuildId, + Ex.what()); + } + catch (const std::exception& Ex) + { + Result.ErrorCode = gsl::narrow(HttpResponseCode::InternalServerError); + Result.Reason = fmt::format("Failed finalizing oplog container build to {}/{}/{}/{}. Reason: '{}'", + m_Url, + m_Namespace, + m_Bucket, + m_BuildId, + Ex.what()); + } + } + return Result; } -- cgit v1.2.3