* finish task #3375.

This commit is contained in:
wangyidong
2017-12-13 11:35:20 +08:00
parent 3eba5feb13
commit cfce20ea3b
2 changed files with 5 additions and 2 deletions
+5 -1
View File
@@ -159,6 +159,7 @@ class cron extends control
while(true)
{
dao::$cache = array();
/* When cron is null then die. */
if(empty($crons)) break;
if(empty($parsedCrons)) break;
@@ -170,10 +171,12 @@ class cron extends control
/* Run crons. */
$now = new datetime('now');
unset($_SESSION['company']);
unset($this->app->company);
$this->common->setCompany();
$this->common->loadConfigFromDB();
foreach($parsedCrons as $id => $cron)
{
$cronInfo = $this->cron->getById($id);
/* Skip empty and stop cron.*/
if(empty($cronInfo) or $cronInfo->status == 'stop') continue;
@@ -211,6 +214,7 @@ class cron extends control
$log = '';
$time = $now->format('G:i:s');
$log = "$time task " . $id . " executed,\ncommand: $cron[command].\nreturn : $return.\noutput : $output\n";
$log .= $this->app->company->name . "\n";
$this->cron->logCron($log);
unset($log);
}