From 8d3adfd1c9b17782de77156c622c7aa219703cb4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Sep 2016 12:22:23 +0200 Subject: [PATCH] Fix --- scripts/cron/cron_run_jobs.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 96450c866a0..290bc9ec74c 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -124,8 +124,7 @@ if (isset($argv[3]) || $argv[3]) $object = new Cronjob($db); $filter=array(); -if (empty($id)) { - $filter=array(); +if (! empty($id)) { $filter['t.rowid']=$id; } @@ -152,7 +151,7 @@ if(is_array($object->lines) && (count($object->lines)>0)) //If date_next_jobs is less of current date, execute the program, and store the execution time of the next execution in database if (($line->datenextrun < $now) && (empty($line->datestart) || $line->datestart <= $now) && (empty($line->dateend) || $line->dateend >= $now)) { - dol_syslog("cron_run_jobs.php:: torun line->datenextrun:".dol_print_date($line->datenextrun,'dayhourrfc')." line->dateend:".dol_print_date($line->dateend,'dayhourrfc')." now:".dol_print_date($now,'dayhourrfc')); + dol_syslog("cron_run_jobs.php:: to run line->datenextrun:".dol_print_date($line->datenextrun,'dayhourrfc')." line->dateend:".dol_print_date($line->dateend,'dayhourrfc')." now:".dol_print_date($now,'dayhourrfc')); $cronjob=new Cronjob($db); $result=$cronjob->fetch($line->id); @@ -181,6 +180,10 @@ if(is_array($object->lines) && (count($object->lines)>0)) } } + else + { + dol_syslog("cron_run_jobs.php:: job not qualified line->datenextrun:".dol_print_date($line->datenextrun,'dayhourrfc')." line->dateend:".dol_print_date($line->dateend,'dayhourrfc')." now:".dol_print_date($now,'dayhourrfc')); + } } }