Browse Source

修改状态更新

pull/81/head
fanshuai 1 year ago
parent
commit
f8f4c2a245
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/scheduling/ExperimentInstanceStatusTask.java

+ 4
- 4
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/scheduling/ExperimentInstanceStatusTask.java View File

@@ -34,7 +34,7 @@ public class ExperimentInstanceStatusTask {
private ModelDependencyDao modelDependencyDao;
private List<Integer> experimentIds = new ArrayList<>();

@Scheduled(cron = "0/30 * * * * ?") // 每30S执行一次
@Scheduled(cron = "0/14 * * * * ?") // 每30S执行一次
public void executeExperimentInsStatus() throws IOException {
// 首先查到所有非终止态的实验实例
List<ExperimentIns> experimentInsList = experimentInsService.queryByExperimentIsNotTerminated();
@@ -49,7 +49,7 @@ public class ExperimentInstanceStatusTask {
}catch (Exception e){
experimentIns.setStatus("Failed");
}
if (!StringUtils.equals(oldStatus,experimentIns.getStatus())){
// if (!StringUtils.equals(oldStatus,experimentIns.getStatus())){
experimentIns.setUpdateTime(new Date());
// 线程安全的添加操作
synchronized (experimentIds) {
@@ -57,7 +57,7 @@ public class ExperimentInstanceStatusTask {
}
updateList.add(experimentIns);

}
// }
// experimentInsDao.update(experimentIns);
}

@@ -105,7 +105,7 @@ public class ExperimentInstanceStatusTask {
}

}
@Scheduled(cron = "0/30 * * * * ?") // / 每30S执行一次
@Scheduled(cron = "0/17 * * * * ?") // / 每30S执行一次
public void executeExperimentStatus() throws IOException {
if (experimentIds.size()==0){
return;


Loading…
Cancel
Save