|
|
@ -88,20 +88,15 @@ public class JobScheduleHelper {
|
|
|
|
} else if (nowTime > jobInfo.getTriggerNextTime()) {
|
|
|
|
} else if (nowTime > jobInfo.getTriggerNextTime()) {
|
|
|
|
// 2.2、trigger-expire < 5s:direct-trigger && make next-trigger-time
|
|
|
|
// 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
|
|
|
|
// 1、trigger
|
|
|
|
JobTriggerPoolHelper.trigger(jobInfo.getId(), TriggerTypeEnum.CRON, -1, null, null);
|
|
|
|
JobTriggerPoolHelper.trigger(jobInfo.getId(), TriggerTypeEnum.CRON, -1, null, null);
|
|
|
|
logger.debug(">>>>>>>>>>> xxl-job, shecule push trigger : jobId = " + jobInfo.getId() );
|
|
|
|
logger.debug(">>>>>>>>>>> xxl-job, shecule push trigger : jobId = " + jobInfo.getId() );
|
|
|
|
|
|
|
|
|
|
|
|
// 2、fresh next
|
|
|
|
// 2、fresh next
|
|
|
|
jobInfo.setTriggerLastTime(jobInfo.getTriggerNextTime());
|
|
|
|
refreshNextValidTime(jobInfo, new Date(jobInfo.getTriggerNextTime()));
|
|
|
|
jobInfo.setTriggerNextTime(nextTime);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// next-trigger-time in 5s, pre-read again
|
|
|
|
// 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
|
|
|
|
// 1、make ring second
|
|
|
|
int ringSecond = (int)((jobInfo.getTriggerNextTime()/1000)%60);
|
|
|
|
int ringSecond = (int)((jobInfo.getTriggerNextTime()/1000)%60);
|
|
|
|