Browse Source

修改更新状态

tags/v20240126
fans 2 years ago
parent
commit
cc856a2235
1 changed files with 4 additions and 8 deletions
  1. +4
    -8
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentInsServiceImpl.java

+ 4
- 8
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentInsServiceImpl.java View File

@@ -57,17 +57,13 @@ public class ExperimentInsServiceImpl implements ExperimentInsService {
@Override
public ExperimentIns queryById(Integer id) {
ExperimentIns experimentIns = this.experimentInsDao.queryById(id);
//获取实例当前状态
String currentStatus = experimentIns.getStatus();

// 检查是否需要调用接口查询状态:当原本状态为null或非终止态时调用argo接口
if (StringUtils.isEmpty(currentStatus) || !isTerminatedState(currentStatus)) {
if (experimentIns != null && (StringUtils.isEmpty(experimentIns.getStatus())) || !isTerminatedState(experimentIns.getStatus())) {
experimentIns = this.queryStatusFromArgo(experimentIns);
// 如果新状态不是null,并且与旧状态不同,则更新状态
if(!StringUtils.isEmpty(experimentIns.getStatus()) && !StringUtils.equals(experimentIns.getStatus(), currentStatus)){
//只有当新状态是终止态时才更新数据库
if (isTerminatedState(experimentIns.getStatus())) {
//同时更新各个节点
this.update(experimentIns);
}

}
return experimentIns;
}


Loading…
Cancel
Save