监控启智智算任务状态定时任务修改判断逻辑

This commit is contained in:
zch 2026-03-21 11:03:07 +08:00
parent 8e5b2cf2cf
commit 24f92273cf
1 changed files with 8 additions and 8 deletions

View File

@ -44,7 +44,7 @@ public class ServiceVersionStatusTask {
STATUS_URL = zsServiceVersionUrl + "/api/v1/getInferenceTaskAsync";
}
// @Scheduled(cron = "0 * * * * ?") // 每分钟执行一次
@Scheduled(cron = "0 * * * * ?") // 每分钟执行一次
public void executeServiceVersionStatus() {
try {
// 1. 调用queryAllVersionList接口获取所有runState为RUNNING的数据
@ -163,7 +163,7 @@ public class ServiceVersionStatusTask {
/**
* 新增定时任务处理已完成的任务获取URL
*/
// @Scheduled(cron = "0 * * * * ?") // 每分钟执行一次
@Scheduled(cron = "0 * * * * ?") // 每分钟执行一次
public void executeSetUrl() {
try {
// 1. 调用queryAllComplList接口获取所有runState为COMPLETED且url为空的数据
@ -205,11 +205,11 @@ public class ServiceVersionStatusTask {
*/
@Scheduled(cron = "0 * * * * ?") // 每分钟执行一次
public void executeServiceStatusChange() {
try {
List<ServiceVersionZs> completedVersions = serviceVersionMapper.queryAllRunList();
if (completedVersions != null && !completedVersions.isEmpty()) {
for (ServiceVersionZs version : completedVersions) {
List<ServiceVersionZs> runningVersions = serviceVersionMapper.queryAllRunList();
if (runningVersions != null && !runningVersions.isEmpty()) {
try {
for (ServiceVersionZs version : runningVersions) {
// 2. 过滤获取数据中的jobSetId字段
String jobSetId = version.getJobSetId();
if (jobSetId != null && !jobSetId.isEmpty()) {
@ -231,9 +231,9 @@ public class ServiceVersionStatusTask {
}
}
}
} catch (Exception e) {
logger.error("Error executing service version URL task", e);
}
} catch (Exception e) {
logger.error("Error executing service version URL task", e);
}
}