Check values when fetching pending packages

main
Simon Quigley 6 days ago
parent e2eb1c0bf2
commit d645b196b7

@ -179,16 +179,16 @@ int check_pending_packages(const std::string& release) {
auto bs = build.buildstate; auto bs = build.buildstate;
if (bs == "Currently building") { if (bs == "Currently building") {
if (build.date_started >= one_hour_ago) { if (build.date_started >= one_hour_ago) {
total_pending += 1; total_pending++;
} }
} else if (bs == "Needs building") { } else if (bs == "Needs building") {
total_pending += 1; total_pending++;
} else if (bs == "Chroot problem" || } else if (bs == "Chroot problem" ||
(bs == "Failed to build" && build.build_log_url.empty())) { (bs == "Failed to build" && build.build_log_url.empty())) {
if (build.can_be_retried) { if (build.can_be_retried) {
if (build.retry()) { if (build.retry()) {
total_pending += 1; total_pending++;
total_retried += 1; total_retried++;
} }
} }
} }
@ -247,10 +247,13 @@ int check_pending_packages(const std::string& release) {
for (auto& s : source_packages) { for (auto& s : source_packages) {
for (auto bin : s.getPublishedBinaries()) { 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) { for (auto& cb : current_builds) {
if (check_builds.find(cb) == check_builds.end()) { if (check_builds.find(cb) == check_builds.end()) {
has_pending = true; has_pending = true;

Loading…
Cancel
Save