From d645b196b797bf9ba720a821fcd3b36f50f33044 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Mon, 16 Dec 2024 18:16:57 -0600 Subject: [PATCH] Check values when fetching pending packages --- cpp/fetch-indexes.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cpp/fetch-indexes.cpp b/cpp/fetch-indexes.cpp index f03fe5d..061a5dc 100644 --- a/cpp/fetch-indexes.cpp +++ b/cpp/fetch-indexes.cpp @@ -179,16 +179,16 @@ int check_pending_packages(const std::string& release) { auto bs = build.buildstate; if (bs == "Currently building") { if (build.date_started >= one_hour_ago) { - total_pending += 1; + total_pending++; } } else if (bs == "Needs building") { - total_pending += 1; + total_pending++; } else if (bs == "Chroot problem" || (bs == "Failed to build" && build.build_log_url.empty())) { if (build.can_be_retried) { if (build.retry()) { - total_pending += 1; - total_retried += 1; + total_pending++; + total_retried++; } } } @@ -247,10 +247,13 @@ int check_pending_packages(const std::string& release) { for (auto& s : source_packages) { for (auto bin : s.getPublishedBinaries()) { - current_builds.insert(bin.build.value().title); + if (bin.build.has_value()) { + current_builds.insert(bin.build.value().title); + } } } + for (auto& cb : current_builds) { if (check_builds.find(cb) == check_builds.end()) { has_pending = true;