Let Builds.timestamp refer to the time the build was added

Previously, for scheduled builds, "timestamp" contained the time the
build was added to the queue, while for finished builds, it was the
time the build finished.  Now it's always the former.
This commit is contained in:
Eelco Dolstra
2013-05-23 10:45:49 -04:00
parent e09622eb29
commit 57b2bb0674
15 changed files with 31 additions and 30 deletions

View File

@ -54,7 +54,6 @@ sub failDependents {
$d->update(
{ finished => 1
, logfile => ''
, timestamp => time # !!! Why change the timestamp?
, iscachedbuild => 0
, buildstatus => $drvPath eq $d->drvpath ? 1 : 2
, starttime => $time
@ -307,7 +306,6 @@ sub doBuild {
, busy => 0
, locker => ''
, logfile => ''
, timestamp => time # !!! Why change the timestamp?
, iscachedbuild => $isCachedBuild
, buildstatus => $buildStatus
, starttime => $startTime

View File

@ -100,7 +100,7 @@ sub checkBuilds {
# Select the highest-priority builds to start.
my @builds = $extraAllowed == 0 ? () : $db->resultset('Builds')->search(
{ finished => 0, busy => 0, system => $system->system, enabled => 1 },
{ join => ['project'], order_by => ["priority DESC", "timestamp"],
{ join => ['project'], order_by => ["priority DESC", "id"],
rows => $extraAllowed });
if (scalar(@builds) > 0) {