]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Worker.php
Merge pull request #11812 from annando/ap-performance
[friendica.git] / src / Core / Worker.php
index 726dade8cf300b958210832a59e0de66e88b302d..62fd321c24b6a32d0800dac49979ebdea5ed765a 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,9 @@ class Worker
 
                DI::lock()->release(self::LOCK_PROCESS);
 
-               return self::getWaitingJobForPID();
+               // Prevents "Return value of Friendica\Core\Worker::workerProcess() must be of the type array, bool returned"
+               $process = self::getWaitingJobForPID();
+               return (is_array($process) ? $process : []);
        }
 
        /**