hydra: error on buildpage for queued build

This commit is contained in:
Rob Vermaas 2010-02-06 07:15:31 +00:00
parent 348db7600c
commit f57b40101a

View file

@ -44,8 +44,8 @@ sub view_build : Chained('build') PathPart('') Args(0) {
$c->stash->{cachedBuild} = $cachedBuildStep->build if defined $cachedBuildStep;
}
(my $lastBuildStep) = $build->buildsteps->search({},{order_by => "stepnr", rows => 1});
if ($build->resultInfo->buildstatus == 1 && $lastBuildStep && isValidPath($lastBuildStep->logfile)) {
(my $lastBuildStep) = $build->buildsteps->search({},{order_by => "stepnr DESC", rows => 1});
if (defined $build->resultInfo && $build->resultInfo->buildstatus == 1 && $lastBuildStep && isValidPath($lastBuildStep->logfile)) {
my $path = $lastBuildStep->logfile;
$c->stash->{logtext} = `tail -n 50 $path`;
}