👌 Retire des commentaires sur les actions
This commit is contained in:
parent
5b3500e193
commit
2efb54f0f8
6
cron.php
6
cron.php
@ -68,7 +68,7 @@ if ($actions->connect()) {
|
|||||||
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
|
// Suppression
|
||||||
$log->error(sprintf('elle est vieille (%s), on la supprime.', $existing_deals[$deal->getId()]->getDateCreation()->format('d/m/Y H:i')));
|
$log->error(sprintf('elle est vieille (%s), on la supprime.', $existing_deals[$deal->getId()]->getDateCreation()->format('d/m/Y H:i')));
|
||||||
// $actions->delete($deal);
|
$actions->delete($deal);
|
||||||
// Backup
|
// Backup
|
||||||
if (!file_exists(BACKUP_DEALS_DIR.'/'.$deal->getId())) {
|
if (!file_exists(BACKUP_DEALS_DIR.'/'.$deal->getId())) {
|
||||||
mkdir(BACKUP_DEALS_DIR . '/' . $deal->getId());
|
mkdir(BACKUP_DEALS_DIR . '/' . $deal->getId());
|
||||||
@ -101,13 +101,13 @@ if ($actions->connect()) {
|
|||||||
foreach (new DirectoryIterator(NEW_DEALS_DIR) as $new_deal) {
|
foreach (new DirectoryIterator(NEW_DEALS_DIR) as $new_deal) {
|
||||||
if ($new_deal->isDir() && !$new_deal->isDot()) {
|
if ($new_deal->isDir() && !$new_deal->isDot()) {
|
||||||
$deal_to_create = \Shikiryu\LBCReposter\Deal::fromJSON($new_deal->getRealPath() . '/data.json');
|
$deal_to_create = \Shikiryu\LBCReposter\Deal::fromJSON($new_deal->getRealPath() . '/data.json');
|
||||||
/*if ($actions->create($deal_to_create)) {
|
if ($actions->create($deal_to_create)) {
|
||||||
delete_folder($new_deal->getRealPath());
|
delete_folder($new_deal->getRealPath());
|
||||||
$log->info(sprintf('L\'annonce %s a bien été créée.', $deal_to_create->getSubject()));
|
$log->info(sprintf('L\'annonce %s a bien été créée.', $deal_to_create->getSubject()));
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
$log->error(sprintf('L\'annonce %s n\'a pas bien été créée. %s', $deal_to_create->getSubject()));
|
$log->error(sprintf('L\'annonce %s n\'a pas bien été créée. %s', $deal_to_create->getSubject()));
|
||||||
}*/
|
}
|
||||||
sleep(30);
|
sleep(30);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user