mirror of
https://github.com/friendica/friendica
synced 2024-12-22 19:20:17 +00:00
Merge pull request #14611 from annando/issue-14609
Issue 14609: Avoid endless worker repetition in case of an execution error
This commit is contained in:
commit
183e3c48e6
1 changed files with 7 additions and 5 deletions
|
@ -558,15 +558,17 @@ class Worker
|
||||||
if ($method_call) {
|
if ($method_call) {
|
||||||
try {
|
try {
|
||||||
call_user_func_array(sprintf('Friendica\Worker\%s::execute', $funcname), $argv);
|
call_user_func_array(sprintf('Friendica\Worker\%s::execute', $funcname), $argv);
|
||||||
} catch (\TypeError $e) {
|
|
||||||
// No need to defer a worker queue entry if the arguments are invalid
|
|
||||||
Logger::notice('Wrong worker arguments', ['class' => $funcname, 'argv' => $argv, 'queue' => $queue, 'message' => $e->getMessage()]);
|
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
Logger::error('Uncaught exception in worker execution', ['class' => get_class($e), 'message' => $e->getMessage(), 'code' => $e->getCode(), 'file' => $e->getFile() . ':' . $e->getLine(), 'trace' => $e->getTraceAsString(), 'previous' => $e->getPrevious()]);
|
Logger::error('Uncaught exception in worker method execution', ['class' => get_class($e), 'message' => $e->getMessage(), 'code' => $e->getCode(), 'file' => $e->getFile() . ':' . $e->getLine(), 'trace' => $e->getTraceAsString(), 'previous' => $e->getPrevious()]);
|
||||||
Worker::defer();
|
Worker::defer();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$funcname($argv, count($argv));
|
try {
|
||||||
|
$funcname($argv, count($argv));
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
Logger::error('Uncaught exception in worker execution', ['message' => $e->getMessage(), 'code' => $e->getCode(), 'file' => $e->getFile() . ':' . $e->getLine(), 'trace' => $e->getTraceAsString(), 'previous' => $e->getPrevious()]);
|
||||||
|
Worker::defer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger::disableWorker();
|
Logger::disableWorker();
|
||||||
|
|
Loading…
Reference in a new issue