Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ways to deal with Daylight Savings time with Quartz Cron Trigger

I have a quartz cron trigger that looks like so:

<bean id="batchProcessCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
    <property name="jobDetail" ref="batchProcessJobDetail" />
    <property name="cronExpression" value="0 30 2 * * ?" />
</bean>

How should I solve this, if I have several configurations that happen within the 2-3am period? Is there an accepted best practice?

Relevant link: http://www.quartz-scheduler.org/docs/faq.html#FAQ-daylightSavings

Basically it says "Deal with it." But my question is how!

like image 645
Jon Bristow Avatar asked Mar 07 '11 18:03

Jon Bristow


1 Answers

I solved it using a separate trigger that only fires (an hour early) on the beginning date of DST for the configurations that happen between 2am and 3am Eastern.

Seems kludgey, but it works...

like image 107
Jon Bristow Avatar answered Nov 03 '22 01:11

Jon Bristow