Skip to content

Commit ab5f20f

Browse files
committed
任务操作逻辑优化,修复边界情况下逻辑中断问题(ISSUE-2081)。
1 parent 8b07bc3 commit ab5f20f

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

doc/XXL-JOB官方文档.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2461,8 +2461,9 @@ public void execute() {
24612461
- b、从该版本(v3.0.x)开始基于 SpringBoot3 + JDK17 构建,
24622462
24632463
### 7.38 版本 v3.0.1 Release Notes[规划中]
2464-
- 1、[规划中]登陆态Token生成逻辑优化,混淆登陆时间属性,降低token泄漏风险;
2465-
- 2、[规划中]组件扫描改为BeanPostProcessor方式,避免小概率情况下提前初始化;底层组件移除单例写法,汇总factory统一管理;
2464+
- 1、【修复】任务操作逻辑优化,修复边界情况下逻辑中断问题(ISSUE-2081)。
2465+
- 2、[规划中]登陆态Token生成逻辑优化,混淆登陆时间属性,降低token泄漏风险;
2466+
- 3、[规划中]组件扫描改为BeanPostProcessor方式,避免小概率情况下提前初始化;底层组件移除单例写法,汇总factory统一管理;
24662467
24672468
### TODO LIST
24682469
- 1、调度隔离:调度中心针对不同执行器,各自维护不同的调度和远程触发组件。

xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,11 @@ public ReturnT<String> remove(int id) {
320320

321321
@Override
322322
public ReturnT<String> start(int id) {
323+
// load and valid
323324
XxlJobInfo xxlJobInfo = xxlJobInfoDao.loadById(id);
325+
if (xxlJobInfo == null) {
326+
return new ReturnT<String>(ReturnT.FAIL.getCode(), I18nUtil.getString("jobinfo_glue_jobid_unvalid"));
327+
}
324328

325329
// valid
326330
ScheduleTypeEnum scheduleTypeEnum = ScheduleTypeEnum.match(xxlJobInfo.getScheduleType(), ScheduleTypeEnum.NONE);
@@ -352,8 +356,13 @@ public ReturnT<String> start(int id) {
352356

353357
@Override
354358
public ReturnT<String> stop(int id) {
359+
// load and valid
355360
XxlJobInfo xxlJobInfo = xxlJobInfoDao.loadById(id);
361+
if (xxlJobInfo == null) {
362+
return new ReturnT<String>(ReturnT.FAIL.getCode(), I18nUtil.getString("jobinfo_glue_jobid_unvalid"));
363+
}
356364

365+
// stop
357366
xxlJobInfo.setTriggerStatus(0);
358367
xxlJobInfo.setTriggerLastTime(0);
359368
xxlJobInfo.setTriggerNextTime(0);

0 commit comments

Comments
 (0)