mirror of https://github.com/elunez/eladmin
修复手动清除子任务id后导致运行定时任务报错 (#671)
parent
fc43600b0e
commit
38262e06b2
|
@ -16,6 +16,7 @@
|
|||
package me.zhengjie.modules.quartz.service.impl;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import me.zhengjie.exception.BadRequestException;
|
||||
import me.zhengjie.modules.quartz.domain.QuartzJob;
|
||||
|
@ -133,6 +134,10 @@ public class QuartzJobServiceImpl implements QuartzJobService {
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public void executionSubJob(String[] tasks) throws InterruptedException {
|
||||
for (String id : tasks) {
|
||||
if (StrUtil.isBlank(id)) {
|
||||
// 如果是手动清除子任务id,会出现id为空字符串的问题
|
||||
continue;
|
||||
}
|
||||
QuartzJob quartzJob = findById(Long.parseLong(id));
|
||||
// 执行任务
|
||||
String uuid = IdUtil.simpleUUID();
|
||||
|
|
Loading…
Reference in New Issue