From 8e904ebfbfa6b6522542038e98671721e9fbb6f0 Mon Sep 17 00:00:00 2001 From: Martchus Date: Fri, 16 Apr 2021 14:05:25 +0200 Subject: [PATCH] Fix starting first build action * Prevent endless recursion * Consider starting parallel sequence also as having started an action to prevent starting also actions which should only start after that parallel sequence --- librepomgr/webapi/routes_buildaction.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/librepomgr/webapi/routes_buildaction.cpp b/librepomgr/webapi/routes_buildaction.cpp index 77a8967..21ed13a 100644 --- a/librepomgr/webapi/routes_buildaction.cpp +++ b/librepomgr/webapi/routes_buildaction.cpp @@ -405,9 +405,11 @@ static std::vector> allocateBuildActionIDs(ServiceS static bool startFirstBuildActions(ServiceSetup &setup, SequencedBuildActions &newActionSequence) { + auto handledFirstAction = false; for (auto &sequencedAction : newActionSequence.actions) { if (auto *const maybeAction = std::get_if>(&sequencedAction)) { auto &action = *maybeAction; + handledFirstAction = true; if (action->isScheduled()) { action->start(setup); } @@ -415,12 +417,12 @@ static bool startFirstBuildActions(ServiceSetup &setup, SequencedBuildActions &n return true; } } else if (auto *const subSequence = std::get_if(&sequencedAction)) { - if (startFirstBuildActions(setup, newActionSequence) && !newActionSequence.concurrent) { + if (startFirstBuildActions(setup, *subSequence) && !newActionSequence.concurrent) { return true; } } } - return false; + return handledFirstAction; } void postBuildActionsFromTask(const Params ¶ms, ResponseHandler &&handler, const std::string &taskName, const std::string &directory,