石英Cron触发器处理夏时制的方法 [英] Ways to deal with Daylight Savings time with Quartz Cron Trigger

查看:88
本文介绍了石英Cron触发器处理夏时制的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个石英cron触发器,看起来像这样:

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>

如果我在2-3am期间发生了几种配置,该如何解决?有公认的最佳实践吗?

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

相关链接: http://www.quartz-scheduler.org/docs/faq.html#FAQ-daylightSavings

基本上说处理。但是我的问题是如何!

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

推荐答案

我使用一个单独的触发器解决了这个问题,该触发器仅在开始日期(一小时前)触发东部夏令时凌晨2点至凌晨3点之间发生的配置的DST。

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...

这篇关于石英Cron触发器处理夏时制的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆