diff --git a/System/Pool/ObjectPool.php b/System/Pool/ObjectPool.php index 8b3b4ebc..622d5441 100644 --- a/System/Pool/ObjectPool.php +++ b/System/Pool/ObjectPool.php @@ -17,42 +17,43 @@ class ObjectPool extends \Snowflake\Abstracts\Pool { - /** - * @param array $config - * @param bool $isMaster - * @return mixed - * @throws Exception - */ - public function getConnection(array $config, bool $isMaster): mixed - { - return $this->get($config[0], $config); - } + /** + * @param array $config + * @param bool $isMaster + * @return mixed + * @throws Exception + */ + public function getConnection(array $config, bool $isMaster): mixed + { + $config[0] = md5($config[0]); + return $this->get($config[0], $config); + } - /** - * @param string $name - * @param array $config - * @return mixed - * @throws ReflectionException - * @throws NotFindClassException - */ - public function createClient(string $name, array $config): mixed - { - // TODO: Implement createClient() method. - return Snowflake::createObject(array_shift($config)); - } + /** + * @param string $name + * @param array $config + * @return mixed + * @throws ReflectionException + * @throws NotFindClassException + */ + public function createClient(string $name, array $config): mixed + { + // TODO: Implement createClient() method. + return Snowflake::createObject(array_shift($config)); + } - /** - * @param string $name - * @param $object - */ - public function release(string $name, mixed $object) - { - if (method_exists($object, 'clean')) { - $object->clean(); - } - $this->push($name, $object); - } + /** + * @param string $name + * @param $object + */ + public function release(string $name, mixed $object) + { + if (method_exists($object, 'clean')) { + $object->clean(); + } + $this->push($name, $object); + } }