From dff9b4f1b29525f93825f46b5c3ce39421df42b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 27 Apr 2021 15:06:38 +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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/System/Abstracts/Pool.php b/System/Abstracts/Pool.php index 0dde27f9..8a9365b3 100644 --- a/System/Abstracts/Pool.php +++ b/System/Abstracts/Pool.php @@ -168,11 +168,11 @@ abstract class Pool extends Component if (!Context::inCoroutine()) { return $this->createClient($name, $callback); } - $time = microtime(true); - if (!$this->hasItem($name)) { + if ($this->_items[$name]->length() < 1) { return $this->createByCallback($name, $callback); } - + + $time = microtime(true); $connection = $this->_items[$name]->pop(0.01); if (microtime(true) - $time >= 0.007) { $this->warning('Worker #' . env('worker') . ' get client use time ' . (microtime(true) - $time));