Improved new generation of sort prio.

This commit is contained in:
Martin Edenhofer 2013-07-01 17:17:07 +02:00
parent 553591c6d1
commit c735187def

View file

@ -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
)