From 792790508376f67639efa8a9a66c46a946a71c1d Mon Sep 17 00:00:00 2001
From: xuxueli <931591021@qq.com>
Date: Wed, 13 Nov 2019 17:59:28 +0800
Subject: [PATCH] update document
---
.../com/xxl/job/admin/core/thread/JobScheduleHelper.java | 9 ++-------
.../main/resources/mybatis-mapper/XxlJobInfoMapper.xml | 2 +-
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobScheduleHelper.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobScheduleHelper.java
index 8e451c53..817d02bd 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobScheduleHelper.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobScheduleHelper.java
@@ -88,20 +88,15 @@ public class JobScheduleHelper {
} else if (nowTime > jobInfo.getTriggerNextTime()) {
// 2.2、trigger-expire < 5s:direct-trigger && make next-trigger-time
- CronExpression cronExpression = new CronExpression(jobInfo.getJobCron());
- long nextTime = cronExpression.getNextValidTimeAfter(new Date()).getTime();
-
// 1、trigger
JobTriggerPoolHelper.trigger(jobInfo.getId(), TriggerTypeEnum.CRON, -1, null, null);
logger.debug(">>>>>>>>>>> xxl-job, shecule push trigger : jobId = " + jobInfo.getId() );
// 2、fresh next
- jobInfo.setTriggerLastTime(jobInfo.getTriggerNextTime());
- jobInfo.setTriggerNextTime(nextTime);
-
+ refreshNextValidTime(jobInfo, new Date(jobInfo.getTriggerNextTime()));
// next-trigger-time in 5s, pre-read again
- if (jobInfo.getTriggerNextTime() - nowTime < PRE_READ_MS) {
+ if (jobInfo.getTriggerStatus()==1 && nowTime + PRE_READ_MS > jobInfo.getTriggerNextTime()) {
// 1、make ring second
int ringSecond = (int)((jobInfo.getTriggerNextTime()/1000)%60);
diff --git a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml
index 0407011a..058ff71f 100644
--- a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml
+++ b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml
@@ -212,7 +212,7 @@
SELECT
FROM xxl_job_info AS t
WHERE t.trigger_status = 1
- and t.trigger_next_time #{maxNextTime}
+ and t.trigger_next_time #{maxNextTime}