Example #1
0
 public void FinishSubtask(string machineName, string agentName, SnSubtask subtask, SnTask task)
 {
     SnTrace.TaskManagement.Write("AgentHub FinishSubtask. Task id:{0}, agent:{1}, title:{2}", task.Id, agentName, subtask.Title);
     try
     {
         TaskDataHandler.FinishSubtask(machineName, agentName, subtask, task);
         TaskMonitorHub.OnTaskEvent(SnTaskEvent.CreateSubtaskFinishedEvent(task.Id, subtask.Title, subtask.Details, task.AppId, task.Tag, machineName, agentName, subtask.Id));
     }
     catch (Exception ex)
     {
         SnLog.WriteException(ex, "AgentHub FinishSubtask failed.", EventId.TaskManagement.General);
     }
 }
Example #2
0
        public async Task FinishSubtask(string machineName, string agentName, SnSubtask subtask, SnTask task)
        {
            SnTrace.TaskManagement.Write("AgentHub FinishSubtask. Task id:{0}, agent:{1}, title:{2}", task.Id, agentName, subtask.Title);
            try
            {
                await _dataHandler.FinishSubtask(machineName, agentName, subtask, task, Context.ConnectionAborted).ConfigureAwait(false);

                await _monitorHub.OnTaskEvent(SnTaskEvent.CreateSubtaskFinishedEvent(task.Id, subtask.Title, subtask.Details,
                                                                                     task.AppId, task.Tag, machineName, agentName, subtask.Id)).ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                SnLog.WriteException(ex, "AgentHub FinishSubtask failed.", EventId.TaskManagement.General);
            }
        }