From af8cd5ca86b330796b491bdfa29cdbb0a6bee00b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 16 Jun 2022 22:17:37 +0200 Subject: [PATCH] Worker::getWaitingJobForPID() can also return FALSE on failure ... :-( --- src/Core/Worker.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Core/Worker.php b/src/Core/Worker.php index 726dade8cf..bcd12f3294 100644 --- a/src/Core/Worker.php +++ b/src/Core/Worker.php @@ -787,10 +787,10 @@ class Worker /** * Returns waiting jobs for the current process id * - * @return array waiting workerqueue jobs + * @return array|bool waiting workerqueue jobs or FALSE on failture * @throws \Exception */ - private static function getWaitingJobForPID(): array + private static function getWaitingJobForPID() { $stamp = (float)microtime(true); $r = DBA::select('workerqueue', [], ['pid' => getmypid(), 'done' => false]); @@ -1011,7 +1011,7 @@ class Worker DI::lock()->release(self::LOCK_PROCESS); - return self::getWaitingJobForPID(); + return (self::getWaitingJobForPID() ?? []); } /** -- 2.39.5