diff --git a/src/hydra-queue-runner/queue-monitor.cc b/src/hydra-queue-runner/queue-monitor.cc index f94007d2..21981aa9 100644 --- a/src/hydra-queue-runner/queue-monitor.cc +++ b/src/hydra-queue-runner/queue-monitor.cc @@ -49,7 +49,7 @@ void State::queueMonitorLoop() conn->get_notifs(); if (auto lowestId = buildsAdded.get()) { - lastBuildId = std::stoi(*lowestId) - 1; + lastBuildId = std::min(lastBuildId, static_cast(std::stoul(*lowestId) - 1)); printMsg(lvlTalkative, "got notification: new builds added to the queue"); } if (buildsRestarted.get()) {