BUGFIX: timestamps of failed runs were wrong
This commit is contained in:
parent
d0974325f5
commit
3352fc52f6
|
@ -185,4 +185,16 @@ class Run
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function toArray(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'id' => $this->getId(),
|
||||||
|
'exitcode' => $this->getExitcode(),
|
||||||
|
'output' => $this->getOutput(),
|
||||||
|
'runtime' => $this->getRuntime(),
|
||||||
|
'timestamp' => $this->getTimestamp(),
|
||||||
|
'flags' => $this->getFlags(),
|
||||||
|
'job' => $this->getJob()->getId(),
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -91,7 +91,7 @@ class JobRepository extends EntityRepository
|
||||||
$failedruns = $runRepo->getRunsForJob($job, true, $jobData['fail-days']);
|
$failedruns = $runRepo->getRunsForJob($job, true, $jobData['fail-days']);
|
||||||
$failed = count($failedruns);
|
$failed = count($failedruns);
|
||||||
$all = count($runRepo->getRunsForJob($job, false, $jobData['fail-days']));
|
$all = count($runRepo->getRunsForJob($job, false, $jobData['fail-days']));
|
||||||
$job->setData('lastfail', $failedruns[0] ?? NULL);
|
$job->setData('lastfail', isset($failedruns[0]) ? $failedruns[0]->toArray() : NULL);
|
||||||
$job->setData('needschecking', $all > 0 && (($failed / $all) * 100) > $jobData['fail-pct']);
|
$job->setData('needschecking', $all > 0 && (($failed / $all) * 100) > $jobData['fail-pct']);
|
||||||
if(!empty($jobData['containertype']) && $jobData['containertype'] != 'none') {
|
if(!empty($jobData['containertype']) && $jobData['containertype'] != 'none') {
|
||||||
$job->setData('host-displayname', $jobData['service'] . ' on ' . $jobData['host']);
|
$job->setData('host-displayname', $jobData['service'] . ' on ' . $jobData['host']);
|
||||||
|
|
Loading…
Reference in New Issue