foreach ($r as $entry) {
// The work will be done
if (!self::execute($entry)) {
- Logger::notice('Process execution failed, quitting.');
+ Logger::warning('Process execution failed, quitting.', ['entry' => $entry]);
return;
}
/**
* 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]);
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 : []);
}
/**