fix: SQL Exception when there is no second task #111

This commit is contained in:
tjq 2020-11-28 16:35:45 +08:00
commit 6da82f92c7

View File

@ -220,6 +220,9 @@ public class OmsScheduleService {
try {
// 查询所有的秒级任务只包含ID
List<Long> jobIds = jobInfoRepository.findByAppIdInAndStatusAndTimeExpressionTypeIn(partAppIds, SwitchableStatus.ENABLE.getV(), TimeExpressionType.frequentTypes);
if (CollectionUtils.isEmpty(jobIds)) {
return;
}
// 查询日志记录表中是否存在相关的任务
List<Long> runningJobIdList = instanceInfoRepository.findByJobIdInAndStatusIn(jobIds, InstanceStatus.generalizedRunningStatus);
Set<Long> runningJobIdSet = Sets.newHashSet(runningJobIdList);