From 2ffdf836451cec355ea55ddd550bc36d580b9e74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 14 Jan 2022 16:05:12 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E6=94=B9=E5=90=8D"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fdf58326 --- kiri-engine/Pool/Connection.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/kiri-engine/Pool/Connection.php b/kiri-engine/Pool/Connection.php index bf277cf8..65040cd5 100644 --- a/kiri-engine/Pool/Connection.php +++ b/kiri-engine/Pool/Connection.php @@ -118,6 +118,19 @@ class Connection extends Component } + /** + * @param string $name + * @param PDO $PDO + * @return void + * @throws Kiri\Exception\ConfigException + * @throws Exception + */ + public function addItem(string $name, PDO $PDO) + { + $this->getPool()->push($name, $PDO); + } + + /** * @param $name * @param $isMaster @@ -128,9 +141,6 @@ class Connection extends Component { $pool = $this->getPool(); $pool->initConnections($name, $isMaster, $max); - for ($i = 0; $i < $max; $i++) { - $pool->push($name, $this->create($name, [])); - } }