|
|
|
@@ -30,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.io.IOException; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.time.Instant; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
/** |
|
|
|
@@ -208,6 +209,21 @@ public class ExperimentInsServiceImpl implements ExperimentInsService { |
|
|
|
experimentIns = queryStatusFromArgo(experimentIns); |
|
|
|
this.experimentInsDao.update(experimentIns); |
|
|
|
updateExperimentStatus(experimentIns.getExperimentId()); |
|
|
|
if (Constant.Failed.equals(experimentIns.getStatus()) || Constant.Succeeded.equals(experimentIns.getStatus())) { |
|
|
|
if (StringUtils.isNotEmpty(experimentIns.getNodesStatus())) { |
|
|
|
Map<String, Object> nodesStatusMap = JsonUtils.jsonToMap(experimentIns.getNodesStatus()); |
|
|
|
for (String key : nodesStatusMap.keySet()) { |
|
|
|
Map<String, Object> value = (Map<String, Object>) nodesStatusMap.get(key); |
|
|
|
String startedAt = (String) value.get("startedAt"); |
|
|
|
Instant instant = Instant.parse(startedAt); |
|
|
|
Date startTime = Date.from(instant); |
|
|
|
String finishedAt = (String) value.get("finishedAt"); |
|
|
|
if (StringUtils.isNotEmpty(finishedAt)) { |
|
|
|
resourceOccupyService.endDeduce(Constant.TaskType_Workflow, null, Long.valueOf(experimentIns.getId()), key, startTime); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return experimentIns; |
|
|
|
} |
|
|
|
|
|
|
|
|