Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Issue forks
queue_order-3224274
Commits
8a46d1b3
Commit
8a46d1b3
authored
Mar 12, 2018
by
Oleh Vehera
Browse files
Support default weight defined in annotation
parent
bba614aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Queue/QueueWorkerManager.php
View file @
8a46d1b3
...
...
@@ -48,7 +48,8 @@ class QueueWorkerManager extends CoreQueueWorkerManager {
$weight
=
$this
->
config
->
get
(
'order'
);
$weight
=
empty
(
$weight
)
?
[]
:
$weight
;
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'
]);
return
$definitions
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment