From d7677de6fcfdefd3b9a437f1197bba929b66529b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 27 Apr 2021 17:49:35 +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 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/System/Abstracts/Pool.php b/System/Abstracts/Pool.php index 56335581..34665bdb 100644 --- a/System/Abstracts/Pool.php +++ b/System/Abstracts/Pool.php @@ -170,7 +170,7 @@ abstract class Pool extends Component } $channel = $this->_items[$name]; if ($channel->isEmpty()) { - return $this->createByCallback($name, $callback); + $this->createByCallback($name, $callback); } $connection = $channel->pop(0.002); if (!$this->checkCanUse($name, $connection)) { @@ -184,17 +184,13 @@ abstract class Pool extends Component /** * @param $name * @param mixed $callback - * @return mixed * @throws Exception */ - private function createByCallback($name, mixed $callback): mixed + private function createByCallback($name, mixed $callback): void { if ($this->creates === -1 && !is_callable($callback)) { $this->creates = Timer::tick(1000, [$this, 'Heartbeat_detection']); } - - return $this->createClient($name, $callback); - if (!Context::hasContext('create::client::ing::' . $name)) { $this->push($name, $this->createClient($name, $callback)); Context::remove('create::client::ing::' . $name);