Browse Source

[fix-#3962][api] Avoid ClassCastException for LoggerService.queryLog(). (#3963)

pull/3/MERGE
t1mon 4 years ago committed by GitHub
parent
commit
e9479e4a03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessInstanceService.java

4
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessInstanceService.java

@ -305,10 +305,10 @@ public class ProcessInstanceService extends BaseService {
private void addDependResultForTaskList(List<TaskInstance> taskInstanceList) throws IOException { private void addDependResultForTaskList(List<TaskInstance> taskInstanceList) throws IOException {
for (TaskInstance taskInstance : taskInstanceList) { for (TaskInstance taskInstance : taskInstanceList) {
if (taskInstance.getTaskType().equalsIgnoreCase(TaskType.DEPENDENT.toString())) { if (taskInstance.getTaskType().equalsIgnoreCase(TaskType.DEPENDENT.toString())) {
Result logResult = loggerService.queryLog( Result<String> logResult = loggerService.queryLog(
taskInstance.getId(), 0, 4098); taskInstance.getId(), 0, 4098);
if (logResult.getCode() == Status.SUCCESS.ordinal()) { if (logResult.getCode() == Status.SUCCESS.ordinal()) {
String log = (String) logResult.getData(); String log = logResult.getData();
Map<String, DependResult> resultMap = parseLogForDependentResult(log); Map<String, DependResult> resultMap = parseLogForDependentResult(log);
taskInstance.setDependentResult(JSONUtils.toJsonString(resultMap)); taskInstance.setDependentResult(JSONUtils.toJsonString(resultMap));
} }

Loading…
Cancel
Save