Reduce I/O in build listings by only fetching required columns
Columns such as "longDescription" can be large, so fetching them when they're not needed is wasteful.
This commit is contained in:
@ -29,7 +29,7 @@ sub overview : Chained('job') PathPart('') Args(0) {
|
||||
|
||||
$c->stash->{lastBuilds} =
|
||||
[ $c->stash->{job}->builds->search({ finished => 1 },
|
||||
{ order_by => 'timestamp DESC', rows => 10 }) ];
|
||||
{ order_by => 'timestamp DESC', rows => 10, columns => [@buildListColumns] }) ];
|
||||
|
||||
$c->stash->{runningBuilds} = [
|
||||
$c->stash->{job}->builds->search(
|
||||
|
@ -83,7 +83,7 @@ sub jobsetIndex {
|
||||
# Last builds for jobset.
|
||||
$c->stash->{lastBuilds} =
|
||||
[ $c->stash->{jobset}->builds->search({ finished => 1 },
|
||||
{ order_by => "timestamp DESC", rows => 5 }) ];
|
||||
{ order_by => "timestamp DESC", rows => 5, columns => [@buildListColumns] }) ];
|
||||
}
|
||||
|
||||
|
||||
|
@ -74,7 +74,7 @@ sub queue :Local {
|
||||
my ($self, $c) = @_;
|
||||
$c->stash->{template} = 'queue.tt';
|
||||
$c->stash->{queue} = [$c->model('DB::Builds')->search(
|
||||
{finished => 0}, {join => ['project'] , order_by => ["priority DESC", "timestamp"], '+select' => ['project.enabled'], '+as' => ['enabled'] })];
|
||||
{finished => 0}, { join => ['project'], order_by => ["priority DESC", "timestamp"], columns => [@buildListColumns], '+select' => ['project.enabled'], '+as' => ['enabled'] })];
|
||||
$c->stash->{flashMsg} = $c->flash->{buildMsg};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user