From b9b4fafe14b2c80191128e439fa687fd8b7a00e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 9 Apr 2025 21:30:41 +0200 Subject: [PATCH] Adjust cronjob interval to ensure daily execution The interval for `AccompanyingPeriodStepChangeCronjob` was reduced from 24 hours to 23 hours and 45 minutes. This change guarantees at least one execution per day, addressing potential issues with timing overlaps. --- .changes/unreleased/Fixed-20250409-212958.yaml | 6 ++++++ .../Lifecycle/AccompanyingPeriodStepChangeCronjob.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changes/unreleased/Fixed-20250409-212958.yaml diff --git a/.changes/unreleased/Fixed-20250409-212958.yaml b/.changes/unreleased/Fixed-20250409-212958.yaml new file mode 100644 index 000000000..30b07baf5 --- /dev/null +++ b/.changes/unreleased/Fixed-20250409-212958.yaml @@ -0,0 +1,6 @@ +kind: Fixed +body: Shorten the delay between two execution of AccompanyingPeriodStepChangeCronjob, to ensure at least one execution in a day +time: 2025-04-09T21:29:58.591267777+02:00 +custom: + Issue: "" + SchemaChange: No schema change diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php index 27553444b..80f3a6081 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php @@ -26,7 +26,7 @@ readonly class AccompanyingPeriodStepChangeCronjob implements CronJobInterface { $now = $this->clock->now(); - if (null !== $cronJobExecution && $now->sub(new \DateInterval('P1D')) < $cronJobExecution->getLastStart()) { + if (null !== $cronJobExecution && $now->sub(new \DateInterval('PT23H45M')) < $cronJobExecution->getLastStart()) { return false; }