From 423d406f3ed9db12ded11d9c8e38922fa2ece1f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 5 Jul 2021 16:00:25 +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/Pool/ClientsPool.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/System/Pool/ClientsPool.php b/System/Pool/ClientsPool.php index 720ca694..b06688b5 100644 --- a/System/Pool/ClientsPool.php +++ b/System/Pool/ClientsPool.php @@ -81,7 +81,14 @@ class ClientsPool extends Component } else { $min = Config::get('databases.pool.min', 1); - var_dump(array_keys(static::$_connections)); + $num = []; + foreach (static::$_connections as $key => $channel) { + if (!isset($num[$key])) { + $num[$key] = 0; + } + $num[$key] += $channel->length(); + } + var_dump($num); // $length = $this->getChannel($name)->length(); // if ($length > $min) {