From 14316d56ed09cda2e1313ef38ba81901fe43403e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 15 Feb 2021 10:22:47 +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/Abstracts/Pool.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/System/Abstracts/Pool.php b/System/Abstracts/Pool.php index a156a189..e1f21db9 100644 --- a/System/Abstracts/Pool.php +++ b/System/Abstracts/Pool.php @@ -120,7 +120,7 @@ abstract class Pool extends Component */ public function createConnect(array $config, string $coroutineName, callable $createHandler): PDO|Redis|null { - if ($this->size($coroutineName) > 0) { + if (!$this->hasItem($coroutineName)) { return $this->get($coroutineName)[1]; } if (Context::hasContext('create:connect:' . $coroutineName)) { @@ -134,7 +134,7 @@ abstract class Pool extends Component return $client; } - $this->push($coroutineName, call_user_func($createHandler, ...$config)); + $this->push($coroutineName, $client); Context::deleteId('create:connect:' . $coroutineName);