Browse Source

:ambulance: Corrige la condition de suppression

master
Shikiryu 2 years ago
parent
commit
7eb44f43a0
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      cron.php

+ 1
- 1
cron.php View File

@@ -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…
Cancel
Save