Skip to content

Commit

Permalink
fix: latter task cannot be executed because taskResult.getLogs() can …
Browse files Browse the repository at this point in the history
…return null and decide(workflowId) will not be invoked
  • Loading branch information
ColinZou authored Dec 12, 2024
1 parent 1259a4a commit efbed09
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -869,10 +869,13 @@ public TaskModel updateTask(TaskResult taskResult) {
task.getTaskId(), workflowId);
LOGGER.error(errorMsg, e);
}

taskResult.getLogs().forEach(taskExecLog -> taskExecLog.setTaskId(task.getTaskId()));
executionDAOFacade.addTaskExecLog(taskResult.getLogs());

List<TaskExecLog> taskLogs = taskResult.getLogs();
Optional.ofNullable(taskLogs)
.ifPresent(
logs -> {
logs.forEach(taskExecLog -> taskExecLog.setTaskId(task.getTaskId()));
executionDAOFacade.addTaskExecLog(taskLogs);
});
if (task.getStatus().isTerminal()) {
long duration = getTaskDuration(0, task);
long lastDuration = task.getEndTime() - task.getStartTime();
Expand Down

0 comments on commit efbed09

Please sign in to comment.