From 73561a8983c9bd3dbae5bf365d2ae82c3fc16b59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Tue, 7 Feb 2023 16:46:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Connection.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Connection.php b/Connection.php index b2da286..4a419b5 100644 --- a/Connection.php +++ b/Connection.php @@ -117,10 +117,13 @@ class Connection extends Component */ public function connectPoolInstance() { - $pool = Config::get('databases.pool.max', 10); if (!empty($this->slaveConfig) && $this->cds != $this->slaveConfig['cds']) { + $pool = $this->pool ?? ['max' => 10, 'min' => 1]; + $this->connection->initConnections('Mysql:' . $this->slaveConfig['cds'], $pool); } else { + $pool = $this->slaveConfig['pool'] ?? ['max' => 10, 'min' => 1]; + $this->connection->initConnections('Mysql:' . $this->cds, $pool); } }