Example #1
0
        public void TaskFinished(SnTaskResult taskResult)
        {
            Debug.WriteLine("#TaskManagerHub> TaskFinished received. Agent: {0}, taskId: {1}, code: {2}, error: {3}", taskResult.AgentName, taskResult.Task.Id, taskResult.ResultCode, taskResult.Error == null ? "" : taskResult.Error.Message);

            // remove the task from the database first
            TaskDataHandler.DeleteTask(taskResult.Task.Id);

            Debug.WriteLine("#TaskManagerHub>FinishTask: task#{0} has been deleted.", taskResult.Task.Id);

            // then call the finalizer
            TaskManagerBase.OnTaskFinished(taskResult);
        }
Example #2
0
 public TaskManagerBase()
 {
     _deadTaskTimer            = new Timer(new TimerCallback(DeadTaskTimerElapsed), null, _handleDeadTaskPeriodInMilliseconds, _handleDeadTaskPeriodInMilliseconds);
     TaskManagerBase._instance = this;
     Debug.WriteLine("#TaskManager> TaskManagerBase._instance assigned.");
 }