From d51a912ddfef2ae69330bfd386be4c4018e4f34e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 14 Apr 2021 15:09:15 +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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/System/Crontab/Producer.php b/System/Crontab/Producer.php index c787677c..46ccb56a 100644 --- a/System/Crontab/Producer.php +++ b/System/Crontab/Producer.php @@ -29,7 +29,9 @@ class Producer extends Component $name = $crontab->getName(); - if ($redis->type(self::CRONTAB_KEY) !== \Redis::REDIS_ZSET) { + if ( + $redis->exists(self::CRONTAB_KEY) && + $redis->type(self::CRONTAB_KEY) !== \Redis::REDIS_ZSET) { throw new Exception('Cache key ' . self::CRONTAB_KEY . ' types error.'); }