BUGFIX: getrunsforjob did only return failed runs
This commit is contained in:
parent
7529684cd5
commit
7f13b929a9
|
@ -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';
|
||||||
|
|
Loading…
Reference in New Issue