| @@ -68,6 +68,9 @@ public class ActiveLearnInsServiceImpl implements ActiveLearnInsService { | |||||
| activeLearnIns = queryStatusFromArgo(activeLearnIns); | activeLearnIns = queryStatusFromArgo(activeLearnIns); | ||||
| activeLearnInsDao.update(activeLearnIns); | activeLearnInsDao.update(activeLearnIns); | ||||
| updateActiveLearnStatus(activeLearnIns.getActiveLearnId()); | updateActiveLearnStatus(activeLearnIns.getActiveLearnId()); | ||||
| if (Constant.Failed.equals(activeLearnIns.getStatus()) || Constant.Succeeded.equals(activeLearnIns.getStatus())) { | |||||
| resourceOccupyService.endDeduce(Constant.TaskType_ActiveLearn, null, activeLearnIns.getId(), null, null); | |||||
| } | |||||
| return activeLearnIns; | return activeLearnIns; | ||||
| } | } | ||||
| @@ -30,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional; | |||||
| import javax.annotation.Resource; | import javax.annotation.Resource; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.text.SimpleDateFormat; | import java.text.SimpleDateFormat; | ||||
| import java.time.Instant; | |||||
| import java.util.*; | import java.util.*; | ||||
| /** | /** | ||||
| @@ -208,6 +209,21 @@ public class ExperimentInsServiceImpl implements ExperimentInsService { | |||||
| experimentIns = queryStatusFromArgo(experimentIns); | experimentIns = queryStatusFromArgo(experimentIns); | ||||
| this.experimentInsDao.update(experimentIns); | this.experimentInsDao.update(experimentIns); | ||||
| updateExperimentStatus(experimentIns.getExperimentId()); | 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; | return experimentIns; | ||||
| } | } | ||||
| @@ -64,6 +64,9 @@ public class MachineLearnInsServiceImpl implements MachineLearnInsService { | |||||
| machineLearnIns = queryStatusFromArgo(machineLearnIns); | machineLearnIns = queryStatusFromArgo(machineLearnIns); | ||||
| machineLearnInsDao.update(machineLearnIns); | machineLearnInsDao.update(machineLearnIns); | ||||
| updateMLStatus(machineLearnIns.getMachineLearnId()); | updateMLStatus(machineLearnIns.getMachineLearnId()); | ||||
| if (Constant.Failed.equals(machineLearnIns.getStatus()) || Constant.Succeeded.equals(machineLearnIns.getStatus())) { | |||||
| resourceOccupyService.endDeduce(Constant.TaskType_ML, null, machineLearnIns.getId(), null, null); | |||||
| } | |||||
| return machineLearnIns; | return machineLearnIns; | ||||
| } | } | ||||
| @@ -76,6 +76,9 @@ public class RayInsServiceImpl implements RayInsService { | |||||
| rayIns = queryStatusFromArgo(rayIns); | rayIns = queryStatusFromArgo(rayIns); | ||||
| rayInsDao.update(rayIns); | rayInsDao.update(rayIns); | ||||
| updateRayStatus(rayIns.getRayId()); | updateRayStatus(rayIns.getRayId()); | ||||
| if (Constant.Failed.equals(rayIns.getStatus()) || Constant.Succeeded.equals(rayIns.getStatus())) { | |||||
| resourceOccupyService.endDeduce(Constant.TaskType_Ray, null, rayIns.getId(), null, null); | |||||
| } | |||||
| return rayIns; | return rayIns; | ||||
| } | } | ||||