From f8b3ee77e5b9d668d6218f14f17278c5ddad57d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 22 Apr 2021 12:42:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Crontab/Producer.php | 11 ++++++----- System/Error/Logger.php | 5 +---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/System/Crontab/Producer.php b/System/Crontab/Producer.php index 8cf247e7..fa7b5645 100644 --- a/System/Crontab/Producer.php +++ b/System/Crontab/Producer.php @@ -57,11 +57,12 @@ class Producer extends Component } - /** - * @param string $name - * @throws Exception - */ - public function exists(string $name) + /** + * @param string $name + * @return bool + * @throws Exception + */ + public function exists(string $name): bool { $redis = Snowflake::app()->getRedis(); if ($redis->exists('crontab:' . md5($name))) { diff --git a/System/Error/Logger.php b/System/Error/Logger.php index e09699c1..df239ca3 100644 --- a/System/Error/Logger.php +++ b/System/Error/Logger.php @@ -96,10 +96,7 @@ class Logger extends Component $message = $this->arrayFormat($message); } if (!empty($message)) { - if (!is_array($this->logs)) { - $this->logs = []; - } - $this->logs[] = [$method, $message]; + $this->write($message, $method); } return $message; }