return false;
}
- // Check for existance and validity of the include file
+ // Check for existence and validity of the include file
$include = $argv[0];
if (method_exists(sprintf('Friendica\Worker\%s', $include), 'execute')) {
/**
* Returns waiting jobs for the current process id
*
- * @return array|bool waiting workerqueue jobs or FALSE on failture
+ * @return array|bool waiting workerqueue jobs or FALSE on failure
* @throws \Exception
*/
private static function getWaitingJobForPID()
return $new_retrial;
}
+ /**
+ * Get the number of retrials for the current worker task
+ *
+ * @return integer
+ */
+ public static function getRetrial(): int
+ {
+ $queue = DI::app()->getQueue();
+ return $queue['retrial'] ?? 0;
+ }
+
/**
* Defers the current worker entry
*