private async Task ProcessTask(Swagger.Api.Task task, IWorkflowTask workflowTask) { _logger.LogInformation(GetWorkerName() + $"Processing task:{task.TaskDefName} id:{task.TaskId}"); //TODO: we need to think about this try-catch try { await AckTask(task); var result = await workflowTask.Execute(task); result.WorkerId = _workerId; await UpdateTask(result); } catch (Exception e) { _logger.LogError(e, GetWorkerName() + "Failed to execute task"); await UpdateTask(task.FailedWithTerminalError(e.ToString())); } }
private async Task AckTask(Swagger.Api.Task task) { var result = await _taskClient.AckTask(task.TaskId, task.WorkerId); _logger.LogInformation(GetWorkerName() + $"Update respone {result}"); }