mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Feature: CronJob for refreshing materialized view association between address and geographical unit
This commit is contained in:
parent
204ebd4415
commit
7d469df62a
@ -32,14 +32,14 @@ class RefreshAddressToGeographicalUnitMaterializedViewCronJob implements CronJob
|
|||||||
|
|
||||||
public function canRun(?CronJobExecution $cronJobExecution): bool
|
public function canRun(?CronJobExecution $cronJobExecution): bool
|
||||||
{
|
{
|
||||||
if ($cronJobExecution->getKey() !== $this->getKey()) {
|
|
||||||
throw new UnexpectedValueException();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (null === $cronJobExecution) {
|
if (null === $cronJobExecution) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($cronJobExecution->getKey() !== $this->getKey()) {
|
||||||
|
throw new UnexpectedValueException();
|
||||||
|
}
|
||||||
|
|
||||||
$now = new DateTimeImmutable('now');
|
$now = new DateTimeImmutable('now');
|
||||||
|
|
||||||
return $cronJobExecution->getLastStart() < $now->sub(new DateInterval('P1D'))
|
return $cronJobExecution->getLastStart() < $now->sub(new DateInterval('P1D'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user