This commit is contained in:
2021-07-05 16:34:55 +08:00
parent 35ce80c19b
commit c075662c59
+6 -5
View File
@@ -91,12 +91,13 @@ class ClientsPool extends Component
if ($channel->length() > $min) { if ($channel->length() > $min) {
$this->flush($channel, $min); $this->flush($channel, $min);
} }
$num[$key] += $channel->length(); $length = $channel->length();
if (str_starts_with($key, 'Mysql') && (Snowflake::isWorker() || Snowflake::isTask())
&& $channel->length() > 0) { $num[$key] += $length;
$this->debug('Worker #' . env('worker') . ' use client -> ' . $key . ':' . $channel->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) { if ($total < 1) {
Timer::clear($this->creates); Timer::clear($this->creates);