From d8392abb8a357b27bb21bd94f161986dd41dea17 Mon Sep 17 00:00:00 2001 From: titrxw <1120309488@qq.com> Date: Thu, 26 Mar 2020 15:14:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=9E=E6=8E=A5=E6=B1=A0?= =?UTF-8?q?=E5=BC=80=E5=90=AF=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Core/Cache/ConnectorManager.php | 2 +- Src/Core/Database/ConnectorManager.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/Core/Cache/ConnectorManager.php b/Src/Core/Cache/ConnectorManager.php index 92c6f71c..92c79ba9 100644 --- a/Src/Core/Cache/ConnectorManager.php +++ b/Src/Core/Cache/ConnectorManager.php @@ -35,7 +35,7 @@ public function connect($name = 'default') : CacheInterface { throw new \RuntimeException('Cache is not configured.'); } - if (empty($poolConfig) || empty($poolConfig['enable'])) { + if (!isCo() || empty($poolConfig) || empty($poolConfig['enable'])) { /** * @var HandlerAbstract $handlerClass */ diff --git a/Src/Core/Database/ConnectorManager.php b/Src/Core/Database/ConnectorManager.php index c51977dc..995fe53d 100644 --- a/Src/Core/Database/ConnectorManager.php +++ b/Src/Core/Database/ConnectorManager.php @@ -34,7 +34,7 @@ public function __construct() { */ public function connect(array $config) { //未设置连接池时,直接返回数据连接对象 - if (empty($this->poolConfig[$config['name']]) || empty($this->poolConfig[$config['name']]['enable'])) { + if (!isCo() || empty($this->poolConfig[$config['name']]) || empty($this->poolConfig[$config['name']]['enable'])) { return $this->getDefaultConnection($config); } $pool = $this->getPool($config['name'], $config);