fixed: take into account the first iteration of the cronjob

This commit is contained in:
2023-07-13 09:03:41 +02:00
parent a7842b2597
commit b0fcffea2d
2 changed files with 10 additions and 3 deletions

View File

@@ -27,6 +27,10 @@ final readonly class CollateAddressWithReferenceOrPostalCodeCronJob implements C
public function canRun(?CronJobExecution $cronJobExecution): bool
{
if (null === $cronJobExecution) {
return true;
}
$now = $this->clock->now();
return $now->sub(new \DateInterval('PT6H')) > $cronJobExecution->getLastStart();