This commit is contained in:
2023-02-07 17:19:31 +08:00
parent d83f061a1c
commit 17fd230ebb
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -97,7 +97,7 @@ class Connection extends Component
public function get(mixed $config, bool $isMaster = false): ?\PDO
{
$name = $config['cds'] . ($isMaster ? 'master' : 'slave');
if (!$this->pool->hasChannel($name, $config['pool']['max'])) {
if (!$this->pool->hasChannel($name)) {
$this->pool->initConnections($name, $config['pool']['max']);
}
return $this->pool->get($name, $this->generate($config));
+1 -1
View File
@@ -139,7 +139,7 @@ class Pool extends Component
}
public function hasChannel($name, $max): bool
public function hasChannel($name): bool
{
$channel = static::$_connections[$name] ?? null;
if (!($channel instanceof PoolQueue)) {