From 0fa38df2c9fda9834bd306bad831c64ba3609b5a Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Fri, 31 Mar 2023 23:36:08 +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 --- kiri-engine/Pool/Connection.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/kiri-engine/Pool/Connection.php b/kiri-engine/Pool/Connection.php index 2bdea9ac..c9008988 100644 --- a/kiri-engine/Pool/Connection.php +++ b/kiri-engine/Pool/Connection.php @@ -100,14 +100,10 @@ class Connection extends Component if (!$this->pool->hasChannel($name)) { $this->pool->initConnections($name, $config['pool']['max']); } - if ($isMaster) { - if (!Context::hasContext($name)) { - return Context::setContext($name, $this->pool->get($name, $this->generate($config))); - } else { - return Context::getContext($name); - } + if (!Context::hasContext($name)) { + return Context::setContext($name, $this->pool->get($name, $this->generate($config))); } else { - return $this->pool->get($name, $this->generate($config)); + return Context::getContext($name); } }