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
|
return @allTasks
|
||||||
|
|
||||||
|
newPrio: ->
|
||||||
|
prio = 1
|
||||||
|
for task in @allTasks
|
||||||
|
if task.prio && task.prio > prio
|
||||||
|
prio = task.prio
|
||||||
|
prio++
|
||||||
|
prio
|
||||||
|
|
||||||
worker: ( key ) ->
|
worker: ( key ) ->
|
||||||
return @workers[ key ] if @workers[ key ]
|
return @workers[ key ] if @workers[ key ]
|
||||||
return
|
return
|
||||||
|
@ -127,7 +135,7 @@ class _taskManagerSingleton extends App.Controller
|
||||||
params: params
|
params: params
|
||||||
callback: callback
|
callback: callback
|
||||||
client_id: 123
|
client_id: 123
|
||||||
prio: @allTasks.length + 1
|
prio: @newPrio()
|
||||||
notify: false
|
notify: false
|
||||||
active: active
|
active: active
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue