|
|
|
@@ -278,7 +278,6 @@ public class ExperimentInsServiceImpl implements ExperimentInsService { |
|
|
|
String name = ins.getArgoInsName(); |
|
|
|
Integer id = ins.getId(); |
|
|
|
// 创建请求数据map |
|
|
|
ExperimentIns experimentIns = this.experimentInsDao.queryById(id); |
|
|
|
Map<String, Object> requestData = new HashMap<>(); |
|
|
|
requestData.put("namespace", namespace); |
|
|
|
requestData.put("name", name); |
|
|
|
@@ -311,7 +310,7 @@ public class ExperimentInsServiceImpl implements ExperimentInsService { |
|
|
|
String finishedAtString = (String) status.get("finishedAt"); |
|
|
|
if (finishedAtString != null && !finishedAtString.isEmpty()) { |
|
|
|
Date finishTime = DateUtils.convertUTCtoShanghaiDate(finishedAtString); |
|
|
|
experimentIns.setFinishTime(finishTime); |
|
|
|
ins.setFinishTime(finishTime); |
|
|
|
} |
|
|
|
|
|
|
|
// 解析nodes字段,提取节点状态并转换为JSON字符串 |
|
|
|
@@ -326,18 +325,16 @@ public class ExperimentInsServiceImpl implements ExperimentInsService { |
|
|
|
} |
|
|
|
|
|
|
|
String nodeStatusJson = JsonUtils.mapToJson(modifiedNodes); |
|
|
|
experimentIns.setNodesStatus(nodeStatusJson); |
|
|
|
ins.setNodesStatus(nodeStatusJson); |
|
|
|
|
|
|
|
//终止态为终止不改 |
|
|
|
if (!StringUtils.equals(experimentIns.getStatus(), Constant.Terminated)) { |
|
|
|
experimentIns.setStatus(StringUtils.isNotEmpty((String) status.get("phase")) ? (String) status.get("phase") : Constant.Pending); |
|
|
|
if (!StringUtils.equals(ins.getStatus(), Constant.Terminated)) { |
|
|
|
ins.setStatus(StringUtils.isNotEmpty((String) status.get("phase")) ? (String) status.get("phase") : Constant.Pending); |
|
|
|
} |
|
|
|
if (StringUtils.equals(experimentIns.getStatus(), Constant.Error)) { |
|
|
|
experimentIns.setStatus(Constant.Failed); |
|
|
|
if (StringUtils.equals(ins.getStatus(), Constant.Error)) { |
|
|
|
ins.setStatus(Constant.Failed); |
|
|
|
} |
|
|
|
|
|
|
|
return experimentIns; |
|
|
|
|
|
|
|
return ins; |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException("查询状态失败: " + e.getMessage(), e); |
|
|
|
|
|
|
|
|