diff --git a/src/hydra-queue-runner/builder.cc b/src/hydra-queue-runner/builder.cc index 2a31ff2e..f89aee72 100644 --- a/src/hydra-queue-runner/builder.cc +++ b/src/hydra-queue-runner/builder.cc @@ -225,9 +225,11 @@ State::StepResult State::doBuildStep(nix::ref destStore, Step::ptr step, finishBuildStep(txn, result.startTime, result.stopTime, result.overhead, build->id, stepNr, machine->sshName, bsSuccess); - for (auto & b : direct) + for (auto & b : direct) { + printMsg(lvlInfo, format("marking build %1% as succeeded") % b->id); markSucceededBuild(txn, b, res, build != b || result.isCached, result.startTime, result.stopTime); + } txn.commit(); } diff --git a/src/hydra-queue-runner/hydra-queue-runner.cc b/src/hydra-queue-runner/hydra-queue-runner.cc index b1842523..a87c10eb 100644 --- a/src/hydra-queue-runner/hydra-queue-runner.cc +++ b/src/hydra-queue-runner/hydra-queue-runner.cc @@ -353,8 +353,6 @@ void visitDependencies(std::function visitor, Step::ptr start) void State::markSucceededBuild(pqxx::work & txn, Build::ptr build, const BuildOutput & res, bool isCachedBuild, time_t startTime, time_t stopTime) { - printMsg(lvlInfo, format("marking build %1% as succeeded") % build->id); - if (build->finishedInDB) return; if (txn.parameterized("select 1 from Builds where id = $1 and finished = 0")(build->id).exec().empty()) return; diff --git a/src/hydra-queue-runner/queue-monitor.cc b/src/hydra-queue-runner/queue-monitor.cc index 5fcccae3..280d4a12 100644 --- a/src/hydra-queue-runner/queue-monitor.cc +++ b/src/hydra-queue-runner/queue-monitor.cc @@ -165,6 +165,7 @@ bool State::getQueuedBuilds(Connection & conn, ref localStore, auto mc = startDbUpdate(); pqxx::work txn(conn); time_t now = time(0); + printMsg(lvlInfo, format("marking build %1% as succeeded (cached)") % build->id); markSucceededBuild(txn, build, res, true, now, now); txn.commit(); }