From 36a278975bb0557ffb7481ecd832db22e742f25f Mon Sep 17 00:00:00 2001 From: dingguodong Date: Tue, 8 Aug 2023 15:26:09 +0800 Subject: [PATCH] * Optimize logging for cron process. --- module/cron/control.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/module/cron/control.php b/module/cron/control.php index 22a45198d3..60c9c7df97 100644 --- a/module/cron/control.php +++ b/module/cron/control.php @@ -208,6 +208,11 @@ class cron extends control $return = ''; if($cron['command']) { + /* Save log of executing cron. */ + $time = $now->format('Y-m-d H:i:s'); + $log = "\n$time task " . $id . " executing,\ncommand: $cron[command]\n"; + $this->cron->logCron($log); + if(isset($crons[$id]) and $crons[$id]->type == 'zentao') { parse_str($cron['command'], $params); @@ -223,7 +228,7 @@ class cron extends control if($output) $output = join("\n", $output); } - /* Save log. */ + /* Save log of executed cron. */ $time = $now->format('Y-m-d H:i:s'); $output = $output;