BUGFIX: getrunsforjob did only return failed runs

This commit is contained in:
Jeroen De Meerleer 2021-08-02 14:41:11 +02:00
parent 7529684cd5
commit 7f13b929a9
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
1 changed files with 2 additions and 2 deletions

View File

@ -13,11 +13,11 @@ class Run extends Repository
const SUCCESS = 'S'; const SUCCESS = 'S';
const MANUAL = 'M'; const MANUAL = 'M';
public function getRunsForJob(int $id, $failed = true, $ordered = true): array public function getRunsForJob(int $id, $onlyfailed = false, $ordered = true): array
{ {
$runsSql = "SELECT * FROM run WHERE job_id = :job"; $runsSql = "SELECT * FROM run WHERE job_id = :job";
$params = [':job' => $id]; $params = [':job' => $id];
if ($failed) { if ($onlyfailed) {
$runsSql .= ' AND flags LIKE "%' . Run::FAILED . '%"'; $runsSql .= ' AND flags LIKE "%' . Run::FAILED . '%"';
} }
if ($ordered) $runsSql .= ' ORDER by timestamp DESC'; if ($ordered) $runsSql .= ' ORDER by timestamp DESC';