From c075662c59a4778d75658a1fba3e186fc05c5ef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 5 Jul 2021 16:34:55 +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 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/System/Pool/ClientsPool.php b/System/Pool/ClientsPool.php index faaddc2e..e8a426e3 100644 --- a/System/Pool/ClientsPool.php +++ b/System/Pool/ClientsPool.php @@ -91,12 +91,13 @@ class ClientsPool extends Component if ($channel->length() > $min) { $this->flush($channel, $min); } - $num[$key] += $channel->length(); - if (str_starts_with($key, 'Mysql') && (Snowflake::isWorker() || Snowflake::isTask()) - && $channel->length() > 0) { - $this->debug('Worker #' . env('worker') . ' use client -> ' . $key . ':' . $channel->length()); + $length = $channel->length(); + + $num[$key] += $length; + if (str_starts_with($key, 'Mysql') && (Snowflake::isWorker() || Snowflake::isTask()) && $length > 0) { + $this->debug('Worker #' . env('worker') . ' use client -> ' . $key . ':' . $length); } - $total += $channel->length(); + $total += $length; } if ($total < 1) { Timer::clear($this->creates);