Commit 8a46d1b3 authored by voleger's avatar voleger
Browse files

Support default weight defined in annotation

parent bba614aa
...@@ -48,7 +48,8 @@ class QueueWorkerManager extends CoreQueueWorkerManager { ...@@ -48,7 +48,8 @@ class QueueWorkerManager extends CoreQueueWorkerManager {
$weight = $this->config->get('order'); $weight = $this->config->get('order');
$weight = empty($weight) ? [] : $weight; $weight = empty($weight) ? [] : $weight;
foreach ($definitions as $key => &$definition) { foreach ($definitions as $key => &$definition) {
$definition['weight'] = empty($weight[$key]) ? 0 : intval($weight[$key]); $definition['cron']['weight'] = empty($definition['cron']['weight']) ? 0 : intval($definition['cron']['weight']);
$definition['weight'] = empty($weight[$key]) ? $definition['cron']['weight'] : intval($weight[$key]);
} }
uasort($definitions, [SortArray::class, 'sortByWeightElement']); uasort($definitions, [SortArray::class, 'sortByWeightElement']);
return $definitions; return $definitions;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment