Fix a huge performance regression in the jobstatus page

The renderBuildStatusIcon function was looking at the
resultInfo and schedulingInfo of each build, causing
a SQL query for every build in the result.
This commit is contained in:
Eelco Dolstra
2011-11-29 19:55:49 +01:00
parent afef502bb6
commit 69e9a91bcb
4 changed files with 27 additions and 22 deletions

View File

@ -82,7 +82,11 @@ sub jobsetIndex {
# Last builds for jobset.
my $tmp = $c->stash->{jobset}->builds;
$c->stash->{lastBuilds} =
[ joinWithResultInfo($c, $tmp)->search({ finished => 1 }, { order_by => "timestamp DESC", rows => 5 }) ];
[ joinWithResultInfo($c, $tmp)->search({ finished => 1 },
{ order_by => "timestamp DESC", rows => 5
, '+select' => ["resultInfo.buildStatus"]
, '+as' => ["buildStatus"]
}) ];
}
sub index : Chained('jobset') PathPart('') Args(0) {