🚑 Corrige la condition de suppression
This commit is contained in:
parent
25f603f4a9
commit
7eb44f43a0
2
cron.php
2
cron.php
@ -56,7 +56,7 @@ if ($actions->connect()) {
|
||||
if (in_array($deal->getId(), array_keys($existing_deals))) {
|
||||
$log->info(sprintf('L\'annonce %s existe déjà, ', $deal->getId()));
|
||||
// si elle est vieille, on supprime et on recréé
|
||||
if ($existing_deals[$deal->getId()]->getDateCreation()->add(new DateInterval('P1W')) <= (new DateTime())) {
|
||||
if ($existing_deals[$deal->getId()]->getDateCreation()->add(new DateInterval('P1W')) >= (new DateTime())) {
|
||||
// Suppression
|
||||
$log->error(sprintf('elle est vieille (%s), on la supprime.', $existing_deals[$deal->getId()]->getDateCreation()->format('d/m/Y H:i')));
|
||||
$actions->delete($deal);
|
||||
|
Loading…
Reference in New Issue
Block a user