Check for bad worker priorities

This commit is contained in:
Michael 2020-12-08 21:58:32 +00:00
parent 7e3196776b
commit dd94fb1242
5 changed files with 15 additions and 6 deletions

View file

@ -421,6 +421,11 @@ class Worker
// For this reason the variables have to be initialized.
DI::profiler()->reset();
if (!in_array($queue['priority'], PRIORITIES)) {
Logger::warning('Invalid period', ['queue' => $queue, 'callstack' => System::callstack(20)]);
$queue['priority'] = PRIORITY_MEDIUM;
}
$a->queue = $queue;
$up_duration = microtime(true) - self::$up_start;
@ -1264,6 +1269,11 @@ class Worker
$found = DBA::exists('workerqueue', ['command' => $command, 'parameter' => $parameters, 'done' => false]);
$added = false;
if (!in_array($priority, PRIORITIES)) {
Logger::warning('Invalid period', ['priority' => $priority, 'command' => $command, 'callstack' => System::callstack(20)]);
$priority = PRIORITY_MEDIUM;
}
// Quit if there was a database error - a precaution for the update process to 3.5.3
if (DBA::errorNo() != 0) {
return false;