[fix] fix the bug of uncorrect statistics of job

This commit is contained in:
tjq 2020-07-08 17:14:40 +08:00
parent 3528a7724f
commit 4e1a447f50
3 changed files with 4 additions and 2 deletions

View File

@ -14,6 +14,7 @@ import java.util.concurrent.*;
* 公用线程池配置
* omsTimingPool用于执行定时任务的线程池
* omsCommonPool用于执行普通任务的线程池
* omsCommonPool用于执行后台任务的线程池这类任务对时间不敏感慢慢执行细水长流即可
* taskScheduler用于定时调度的线程池
*
* @author tjq

View File

@ -30,6 +30,6 @@ public interface JobInfoRepository extends JpaRepository<JobInfoDO, Long> {
// 校验工作流包含的任务
long countByAppIdAndStatusAndIdIn(Long appId, int status, List<Long> jobIds);
long countByAppId(long appId);
long countByAppIdAndStatusNot(long appId, int status);
}

View File

@ -11,6 +11,7 @@ import com.github.kfcfans.powerjob.common.response.ResultDTO;
import com.github.kfcfans.powerjob.common.utils.JsonUtils;
import com.github.kfcfans.powerjob.server.akka.OhMyServer;
import com.github.kfcfans.powerjob.server.akka.requests.FriendQueryWorkerClusterStatusReq;
import com.github.kfcfans.powerjob.server.common.constans.SwitchableStatus;
import com.github.kfcfans.powerjob.server.persistence.core.model.AppInfoDO;
import com.github.kfcfans.powerjob.server.persistence.core.repository.AppInfoRepository;
import com.github.kfcfans.powerjob.server.persistence.core.repository.InstanceInfoRepository;
@ -98,7 +99,7 @@ public class SystemInfoController {
SystemOverviewVO overview = new SystemOverviewVO();
// 总任务数量
overview.setJobCount(jobInfoRepository.countByAppId(appId));
overview.setJobCount(jobInfoRepository.countByAppIdAndStatusNot(appId, SwitchableStatus.DELETED.getV()));
// 运行任务数
overview.setRunningInstanceCount(instanceInfoRepository.countByAppIdAndStatus(appId, InstanceStatus.RUNNING.getV()));
// 近期失败任务数24H内