From ce65a3718c5434b592e0f4cd496f9af4e9775135 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 30 Apr 2012 12:08:39 +0000 Subject: [PATCH] =?UTF-8?q?Pr=C3=A9paration=20pour=20reprise=20automatique?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- batch/cron.php | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/batch/cron.php b/batch/cron.php index 805f241e..2b88da7e 100644 --- a/batch/cron.php +++ b/batch/cron.php @@ -53,19 +53,23 @@ $sql = $commandesM->select() ->where("dateStart != '0000-00-00 00:00:00'") ->where("dateStop = '0000-00-00 00:00:00'"); $result = $commandesM->fetchAll($sql); -if (count($result)>0){ - exit; -} +if ( count($result)>0 ) { -//Si pas de traitement en cours alors on lance -$sql = $commandesM->select() - ->where('idProfil != ?', 0) - ->where("dateStart = '0000-00-00 00:00:00'") - ->where("dateStop = '0000-00-00 00:00:00'") - ->order('dateAdded ASC')->limit(1); -$result = $commandesM->fetchAll($sql); -if (count($result)>0) { - $info = $result->current(); - echo "Lancement enrichissement $info->id\n"; - exec(realpath(dirname(__FILE__))."/enrichissement.php --id ".$info->id." &"); + + +} else { + + //Si pas de traitement en cours alors on lance + $sql = $commandesM->select() + ->where('idProfil != ?', 0) + ->where("dateStart = '0000-00-00 00:00:00'") + ->where("dateStop = '0000-00-00 00:00:00'") + ->order('dateAdded ASC')->limit(1); + $result = $commandesM->fetchAll($sql); + if (count($result)>0) { + $info = $result->current(); + echo "Lancement enrichissement $info->id\n"; + exec(realpath(dirname(__FILE__))."/enrichissement.php --id ".$info->id." &"); + } + } \ No newline at end of file