Improved new generation of sort prio.
This commit is contained in:
parent
553591c6d1
commit
c735187def
1 changed files with 9 additions and 1 deletions
|
@ -105,6 +105,14 @@ class _taskManagerSingleton extends App.Controller
|
|||
)
|
||||
return @allTasks
|
||||
|
||||
newPrio: ->
|
||||
prio = 1
|
||||
for task in @allTasks
|
||||
if task.prio && task.prio > prio
|
||||
prio = task.prio
|
||||
prio++
|
||||
prio
|
||||
|
||||
worker: ( key ) ->
|
||||
return @workers[ key ] if @workers[ key ]
|
||||
return
|
||||
|
@ -127,7 +135,7 @@ class _taskManagerSingleton extends App.Controller
|
|||
params: params
|
||||
callback: callback
|
||||
client_id: 123
|
||||
prio: @allTasks.length + 1
|
||||
prio: @newPrio()
|
||||
notify: false
|
||||
active: active
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue