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); }