use of com.vip.saturn.job.trigger.SaturnScheduler in project Saturn by vipshop.
the class JobScheduler method getNextFireTimePausePeriodEffected.
/**
* 获取下次作业触发时间.可能被暂停时间段所影响。
*
* @return 下次作业触发时间
*/
public Date getNextFireTimePausePeriodEffected() {
SaturnScheduler saturnScheduler = job.getScheduler();
if (saturnScheduler == null) {
return null;
}
Trigger trigger = saturnScheduler.getTrigger();
if (trigger == null) {
return null;
}
((OperableTrigger) trigger).updateAfterMisfire(null);
Date nextFireTime = trigger.getNextFireTime();
while (nextFireTime != null && configService.isInPausePeriod(nextFireTime)) {
nextFireTime = trigger.getFireTimeAfter(nextFireTime);
}
if (null == nextFireTime) {
return null;
}
return nextFireTime;
}
Aggregations