Fix: wrong "lastoutput" and "lastresult" if jobtype is "method" or

"function"
This commit is contained in:
Regis Houssin 2016-08-22 20:49:14 +02:00
parent 965011c8bc
commit 6b3cbc918d

View File

@ -1033,21 +1033,21 @@ class Cronjob extends CommonObject
} }
if (! empty($conf->global->MAIN_UMASK)) @chmod($outputfile, octdec($conf->global->MAIN_UMASK)); if (! empty($conf->global->MAIN_UMASK)) @chmod($outputfile, octdec($conf->global->MAIN_UMASK));
} }
}
dol_syslog(get_class($this)."::run_jobs output_arr:".var_export($output_arr,true), LOG_DEBUG); dol_syslog(get_class($this)."::run_jobs output_arr:".var_export($output_arr,true), LOG_DEBUG);
// Update with result
// Update with result $this->lastoutput='';
$this->lastoutput=''; if (is_array($output_arr) && count($output_arr)>0)
if (is_array($output_arr) && count($output_arr)>0)
{
foreach($output_arr as $val)
{ {
$this->lastoutput.=$val."\n"; foreach($output_arr as $val)
{
$this->lastoutput.=$val."\n";
}
} }
$this->lastresult=$retval;
} }
$this->lastresult=$retval;
$this->datelastresult=dol_now(); $this->datelastresult=dol_now();
$result = $this->update($user); $result = $this->update($user);
if ($result < 0) if ($result < 0)