Lets say that I have a quartz trigger SimpleTrigger
that fires every second and start time is set to 12:00:00 today. It开发者_StackOverflow seems that when I schedule that trigger at 12:00:10 then it fires immediately 10 times. Is there a way to avoid that kind of behaviour or should I just manually set start time to 12:00:10 before scheduling?
Set the misfire instruction policy for your particular trigger type. This doc explains what are the available options for the SimpleTrigger http://quartz-scheduler.org/documentation/quartz-2.x/tutorials/tutorial-lesson-05
By default SimpleTrigger has MISFIRE_INSTRUCTION_SMART_POLICY policy active.
You may want to have a look at setMisfireInstruction() and choose the most suitable instruction supported by SimpleTrigger.
精彩评论