From 4615d5824719ab386564ebbe2105752f7a9d8770 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Tue, 23 Feb 2021 00:40:51 +0800 Subject: [PATCH] modify --- System/Pool/ObjectPool.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/System/Pool/ObjectPool.php b/System/Pool/ObjectPool.php index b1682c3a..620b8d3e 100644 --- a/System/Pool/ObjectPool.php +++ b/System/Pool/ObjectPool.php @@ -17,6 +17,15 @@ class ObjectPool extends \Snowflake\Abstracts\Pool { + /** + * set pool max length + */ + public function init() + { + $this->max = 100; + } + + /** * @param array $config * @param bool $isMaster @@ -25,9 +34,7 @@ class ObjectPool extends \Snowflake\Abstracts\Pool */ public function getConnection(array $config, bool $isMaster): mixed { - $config[0] = md5($config[0]); - $this->max = 100; - return $this->get($config[0], $config); + return $this->get(md5($config[0]), $config); }