]> git.mxchange.org Git - friendica.git/commitdiff
Worker::getWaitingJobForPID() can also return FALSE on failure ... :-(
authorRoland Häder <roland@mxchange.org>
Thu, 16 Jun 2022 20:17:37 +0000 (22:17 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 17 Jun 2022 15:18:31 +0000 (17:18 +0200)
src/Core/Worker.php

index 726dade8cf300b958210832a59e0de66e88b302d..bcd12f3294904eed7149f0e65010ee8403d104ec 100644 (file)
@@ -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() ?? []);
        }
 
        /**