diff --git a/src/hydra-queue-runner/hydra-queue-runner.cc b/src/hydra-queue-runner/hydra-queue-runner.cc index 632b11c0..6f6d2219 100644 --- a/src/hydra-queue-runner/hydra-queue-runner.cc +++ b/src/hydra-queue-runner/hydra-queue-runner.cc @@ -342,11 +342,13 @@ int State::createBuildStep(pqxx::work & txn, time_t startTime, Build::ptr build, txn.parameterized ("insert into BuildSteps (build, stepnr, type, drvPath, busy, startTime, system, status, propagatedFrom, errorMsg, stopTime, machine) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)") - (build->id)(stepNr)(0)(step->drvPath)(status == bssBusy ? 1 : 0)(startTime)(step->drv.platform) + (build->id)(stepNr)(0)(step->drvPath)(status == bssBusy ? 1 : 0) + (startTime, startTime != 0) + (step->drv.platform) ((int) status, status != bssBusy) (propagatedFrom, propagatedFrom != 0) (errorMsg, errorMsg != "") - (startTime, status != bssBusy) + (startTime, startTime != 0 && status != bssBusy) (machine).exec(); for (auto & output : step->drv.outputs) @@ -530,7 +532,7 @@ void State::getQueuedBuilds(Connection & conn, std::shared_ptr store, ((int) buildStatus) (now) (buildStatus != bsUnsupported ? 1 : 0).exec(); - createBuildStep(txn, now, build, r, "", buildStepStatus); + createBuildStep(txn, 0, build, r, "", buildStepStatus); txn.commit(); badStep = true; break; @@ -980,7 +982,7 @@ void State::doBuildStep(std::shared_ptr store, Step::ptr step, on this. */ for (auto build2 : dependents) { if (build == build2) continue; - createBuildStep(txn, result.stopTime, build2, step, machine->sshName, bssFailed, result.errorMsg, build->id); + createBuildStep(txn, 0, build2, step, machine->sshName, bssFailed, result.errorMsg, build->id); } finishBuildStep(txn, result.startTime, result.stopTime, build->id, stepNr, machine->sshName, bssFailed, result.errorMsg); diff --git a/src/root/build.tt b/src/root/build.tt index dc689cdd..8da24e1b 100644 --- a/src/root/build.tt +++ b/src/root/build.tt @@ -36,7 +36,7 @@ IF step.stoptime; INCLUDE renderDuration duration = step.stoptime - step.starttime; ELSE; - %]?[% + %]n/a[% END; ELSIF build.finished; INCLUDE renderDuration duration = build.stoptime - step.starttime; @@ -186,13 +186,17 @@ [% IF cachedBuild; INCLUDE renderFullBuildLink build=cachedBuild; ELSE %]unknown[% END %] [% END %] - [% IF !isAggregate && build.finished %] - - Duration: - [% actualBuild = build.iscachedbuild ? cachedBuild : build; - INCLUDE renderDuration duration = actualBuild.stoptime - actualBuild.starttime %]; - finished at [% INCLUDE renderDateTime timestamp = actualBuild.stoptime %] - + [% IF !isAggregate && build.finished; actualBuild = build.iscachedbuild ? cachedBuild : build %] + [% IF actualBuild %] + + Duration: + [% INCLUDE renderDuration duration = actualBuild.stoptime - actualBuild.starttime %] + + [% END %] + + Finished at: + [% INCLUDE renderDateTime timestamp = build.stoptime; %] + [% END %] [% IF !isAggregate && buildLogExists(build) %] @@ -298,7 +302,7 @@ - + [% IF build.finished && !build.iscachedbuild %]
Queued:Queued at: [% INCLUDE renderDateTime timestamp = build.timestamp %]