From cc54616d7b633dbf148a54f2d505c40cc47815cd Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Mon, 2 Aug 2021 10:54:50 +0200 Subject: [PATCH] BUGFIX: slow jobs without runs trigger timeouts --- src/Repository/Job.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Repository/Job.php b/src/Repository/Job.php index 0aa6806..73e8934 100644 --- a/src/Repository/Job.php +++ b/src/Repository/Job.php @@ -242,7 +242,8 @@ class Job extends Repository public function runNow($job, $console = false) { $job = $this->getJob($job, true); $runRepo = new Run($this->dbcon); - if($console == false && ($runRepo->isSlowJob($job['id']) || $job['data']['crontype'] === 'reboot')) { + + if($console == false && ($runRepo->isSlowJob($job['id']) || count($runRepo->getRunsForJob($job['id'])) == 0 || $job['data']['crontype'] === 'reboot')) { $jobsSql = "UPDATE job SET running = :status WHERE id = :id AND running IN (0,1,2)"; $jobsStmt = $this->dbcon->prepare($jobsSql); $jobsStmt->executeQuery([':id' => $job['id'], ':status' => 2]);