From f8a577a085514b5506f196a847878484337c4ad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 27 Apr 2021 18:43:29 +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 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/System/Abstracts/Pool.php b/System/Abstracts/Pool.php index 57e9c337..c432ba79 100644 --- a/System/Abstracts/Pool.php +++ b/System/Abstracts/Pool.php @@ -168,11 +168,14 @@ abstract class Pool extends Component if (!Context::inCoroutine()) { return $this->createClient($name, $callback); } - $channel = $this->_items[$name]; - if ($channel->isEmpty()) { + if ($this->_items[$name]->isEmpty()) { $this->createByCallback($name, $callback); } - $connection = $channel->pop(0.002); + $time = microtime(true); + $connection = $this->_items[$name]->pop(0.002); + if (($end = microtime(true) - $time) >= 0.01) { + $this->error('waite channel connect use time.' . $end); + } if (!$this->checkCanUse($name, $connection)) { return $this->createClient($name, $callback); } else {