改名
This commit is contained in:
@@ -80,6 +80,17 @@ class ClientsPool extends Component
|
|||||||
Timer::clear($this->creates);
|
Timer::clear($this->creates);
|
||||||
$this->creates = -1;
|
$this->creates = -1;
|
||||||
} else {
|
} else {
|
||||||
|
$this->heartbeat_flush();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws ConfigException
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
private function heartbeat_flush()
|
||||||
|
{
|
||||||
$min = Config::get('databases.pool.min', 1);
|
$min = Config::get('databases.pool.min', 1);
|
||||||
|
|
||||||
$num = [];
|
$num = [];
|
||||||
@@ -88,11 +99,10 @@ class ClientsPool extends Component
|
|||||||
if (!isset($num[$key])) {
|
if (!isset($num[$key])) {
|
||||||
$num[$key] = 0;
|
$num[$key] = 0;
|
||||||
}
|
}
|
||||||
if ($channel->length() > $min) {
|
$length = $channel->length();
|
||||||
|
if ($length > $min) {
|
||||||
$this->flush($channel, $min);
|
$this->flush($channel, $min);
|
||||||
}
|
}
|
||||||
$length = $channel->length();
|
|
||||||
|
|
||||||
$num[$key] += $length;
|
$num[$key] += $length;
|
||||||
if (str_starts_with($key, 'Mysql') && (Snowflake::isWorker() || Snowflake::isTask()) && $length > 0) {
|
if (str_starts_with($key, 'Mysql') && (Snowflake::isWorker() || Snowflake::isTask()) && $length > 0) {
|
||||||
$this->debug('Worker #' . env('worker') . ' use client -> ' . $key . ':' . $length);
|
$this->debug('Worker #' . env('worker') . ' use client -> ' . $key . ':' . $length);
|
||||||
@@ -104,7 +114,6 @@ class ClientsPool extends Component
|
|||||||
$this->creates = -1;
|
$this->creates = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user