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.'); }