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