Added debug info.

This commit is contained in:
Martin Edenhofer 2013-08-14 01:05:08 +02:00
parent c279e6f5cf
commit 32143167d8

View file

@ -68,7 +68,6 @@ class _taskManagerSingleton extends App.Controller
@workersStarted = {} @workersStarted = {}
@allTasks = [] @allTasks = []
@tasksToUpdate = {} @tasksToUpdate = {}
@initialLoad = true
@activeTask = undefined @activeTask = undefined
@tasksInitial() @tasksInitial()
@ -76,8 +75,6 @@ class _taskManagerSingleton extends App.Controller
App.Event.bind( App.Event.bind(
'auth:login' 'auth:login'
=> =>
@initialLoad = true
@all()
@tasksInitial() @tasksInitial()
'task' 'task'
) )
@ -95,13 +92,6 @@ class _taskManagerSingleton extends App.Controller
all: -> all: ->
# initial load of taskbar collection
if @initialLoad
@initialLoad = false
tasks = App.Taskbar.all()
for task in tasks
@allTasks.push task.attributes()
# sort by prio # sort by prio
@allTasks = _(@allTasks).sortBy( (task) -> @allTasks = _(@allTasks).sortBy( (task) ->
return task.prio; return task.prio;
@ -316,7 +306,7 @@ class _taskManagerSingleton extends App.Controller
@allTasks = [] @allTasks = []
@activeTask = undefined @activeTask = undefined
# clear inmem tasks # clear in mem tasks
App.Taskbar.deleteAll() App.Taskbar.deleteAll()
# rerender task bar # rerender task bar
@ -348,6 +338,7 @@ class _taskManagerSingleton extends App.Controller
if ui.tasksToUpdate[ @key ] is 'inProgress' if ui.tasksToUpdate[ @key ] is 'inProgress'
delete ui.tasksToUpdate[ @key ] delete ui.tasksToUpdate[ @key ]
error: (task) => error: (task) =>
ui.log 'error', "can't update task '#{task.id}'"
if ui.tasksToUpdate[ @key ] is 'inProgress' if ui.tasksToUpdate[ @key ] is 'inProgress'
delete ui.tasksToUpdate[ @key ] delete ui.tasksToUpdate[ @key ]
) )
@ -371,17 +362,19 @@ class _taskManagerSingleton extends App.Controller
tasksInitial: => tasksInitial: =>
# initial load of taskbar collection
tasks = App.Taskbar.all()
@allTasks = []
for task in tasks
@allTasks.push task.attributes()
# reopen tasks # reopen tasks
App.Event.trigger 'taskbar:init' App.Event.trigger 'taskbar:init'
# check if we have different
tasks = @all()
return if !tasks
task_count = 0 task_count = 0
for task in tasks for task in @allTasks
task_count += 1 task_count += 1
console.log('START', task)
App.Delay.set( App.Delay.set(
=> =>
task = tasks.shift() task = tasks.shift()