getPreviousBuild: Get previous build in the job, not jobset
Broken since 8adb433e3
.
This commit is contained in:
parent
a1b5418114
commit
d9dc7ca18b
|
@ -46,11 +46,13 @@ sub getBuild {
|
||||||
sub getPreviousBuild {
|
sub getPreviousBuild {
|
||||||
my ($build) = @_;
|
my ($build) = @_;
|
||||||
return undef if !defined $build;
|
return undef if !defined $build;
|
||||||
|
# FIXME: slow
|
||||||
return $build->jobset->builds->search(
|
return $build->jobset->builds->search(
|
||||||
{ finished => 1
|
{ finished => 1
|
||||||
, system => $build->system
|
, system => $build->system
|
||||||
, 'me.id' => { '<' => $build->id }
|
, 'me.id' => { '<' => $build->id }
|
||||||
, -not => { buildstatus => { -in => [4, 3]} }
|
, job => $build->job
|
||||||
|
, -not => { buildstatus => { -in => [4, 3]} }
|
||||||
}, { rows => 1, order_by => "me.id DESC" })->single;
|
}, { rows => 1, order_by => "me.id DESC" })->single;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue