|
|
|
@ -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); |
|
|
|
|