mirror of
https://github.com/friendica/friendica
synced 2024-12-23 04:00:15 +00:00
Fix worker priorities
This commit is contained in:
parent
1f43332a1d
commit
e19681684b
1 changed files with 7 additions and 1 deletions
|
@ -661,7 +661,8 @@ class Worker
|
|||
} else {
|
||||
// Kill long running processes
|
||||
// Check if the priority is in a valid range
|
||||
if (!in_array($entry["priority"], [PRIORITY_CRITICAL, PRIORITY_HIGH, PRIORITY_MEDIUM, PRIORITY_LOW, PRIORITY_NEGLIGIBLE])) {
|
||||
if (!in_array($entry["priority"], PRIORITIES)) {
|
||||
Logger::warning('Invalid priority', ['entry' => $entry, 'callstack' => System::callstack(20)]);
|
||||
$entry["priority"] = PRIORITY_MEDIUM;
|
||||
}
|
||||
|
||||
|
@ -1391,6 +1392,11 @@ class Worker
|
|||
$id = $queue['id'];
|
||||
$priority = $queue['priority'];
|
||||
|
||||
if (!in_array($priority, PRIORITIES)) {
|
||||
Logger::warning('Invalid priority', ['queue' => $queue, 'callstack' => System::callstack(20)]);
|
||||
$priority = PRIORITY_MEDIUM;
|
||||
}
|
||||
|
||||
$max_level = DI::config()->get('system', 'worker_defer_limit');
|
||||
|
||||
$new_retrial = self::getNextRetrial($queue, $max_level);
|
||||
|
|
Loading…
Reference in a new issue