legacy-knowledge-base
公開されました Sep. 10, 2025

夏時間中の Liferay トリガーの実行

written-by

Manuel Rives Pérez

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

夏に時差がある日の場合、Quartz ライブラリはどうなりますか? 一部のプロセスがトリガーされない可能性がありますか?

環境

  • Liferay DXP 7.1
  • Liferay DXP 7.2
  • Liferay DXP 7.3

解決策

Liferay は Quartz ライブラリを利用します。 したがって、この状況で製品が持つと推測しなければならない動作は、ライブラリと同じになります。

Quartz の公式ドキュメントを参照すると、公開されたバージョン (http://www.quartz-scheduler.org/documentation/2.3.1-SNAPSHOT/faq.html) の FAQ で説明されていることがわかります。時間が発生しない場合、アクションは実行されません。 CronTrigger を使用する場合:

 SimpleTrigger ALWAYS fires exactly every N seconds, with no relation to the time of day. CronTrigger ALWAYS fires at a given time of day and then computes its next time to fire. If that time does not occur on a given day, the trigger will be skipped. If the time occurs twice in a given day, it only fires once, because after firing on that time the first time, it computes the next time of day to fire on.

一方、DXP 7.2 (2.1.7) で使用されているバージョンにアクセスすると、もう少し正確になります。 javadoc (https://www.javadoc.io/doc/org.quartz-scheduler/quartz/2.1.7/org/quartz/CronTrigger.html) では、場合上げていただきます。 ドキュメントは、提案された状況に注意するようアドバイスしています。

Be careful when setting fire times between mid-night and 1:00 AM - "daylight savings" can cause a skip or a repeat depending on whether the time moves back or jumps forward.

 Trigger trigger = _triggerFactory.createTrigger(
className, className, null, null,
journalServiceConfiguration.checkInterval(), TimeUnit.MINUTE);


SchedulerEntry schedulerEntry = new SchedulerEntryImpl(
className, trigger);


_schedulerEngineHelper.register(
this, schedulerEntry, DestinationNames.SCHEDULER_DISPATCH);

このクラスを見ると、間隔として一連の分を指定して TriggerFactory を呼び出しているため、SimpleTrigger が作成されます。 この SimpleTrigger は、時間の変更に関係なく常に実行されます。

一方、DeleteMBMessagesListener クラスを見ると、次のようになります。

 		Trigger trigger = _triggerFactory.createTrigger(
clazz.getName(), clazz.getName(), new Date(), null, cronExpression);


_schedulerEntryImpl = new SchedulerEntryImpl(clazz.getName(), trigger);


if (_initialized) {
deactivate();
}


_schedulerEngineHelper.register(
this, _schedulerEntryImpl, DestinationNames.SCHEDULER_DISPATCH);

この場合、CronTrigger タイプのトリガーのインスタンスを作成しています。 これらのトリガーは、時間の変更の影響を受けます。

このすべての情報から、CronScheduleBuilder を使用すると、夏時間によって失われた時間にタスクが実行されないと結論付けることができます。

追加情報

did-this-article-resolve-your-issue

legacy-knowledge-base