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

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