From d5293f28b7b4f06e7a6bba98c873619c1dbf72ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Thu, 24 Feb 2022 13:53:03 +0800 Subject: [PATCH] modify plugin name --- kiri-engine/Pool/Redis.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/kiri-engine/Pool/Redis.php b/kiri-engine/Pool/Redis.php index eb1aee93..d19f8971 100644 --- a/kiri-engine/Pool/Redis.php +++ b/kiri-engine/Pool/Redis.php @@ -30,7 +30,7 @@ class Redis extends Component */ public function get(mixed $config, bool $isMaster = false): mixed { - $coroutineName = $this->name('Redis:' . $config['host'], $isMaster); + $coroutineName = $config['host']; if (Context::hasContext($coroutineName)) { return Context::getContext($coroutineName); } @@ -63,7 +63,7 @@ class Redis extends Component */ public function release(array $config, bool $isMaster = false) { - $coroutineName = $this->name('Redis:' . $config['host'], $isMaster); + $coroutineName = $config['host']; if (!Context::hasContext($coroutineName)) { return; } @@ -79,9 +79,8 @@ class Redis extends Component */ public function destroy(array $config, bool $isMaster = false) { - $coroutineName = $this->name('Redis:' . $config['host'], $isMaster); - $this->getPool()->clean($coroutineName); - Context::remove($coroutineName); + $this->getPool()->clean($config['host']); + Context::remove($config['host']); } @@ -92,8 +91,7 @@ class Redis extends Component */ public function connection_clear(array $config, bool $isMaster = false) { - $coroutineName = $this->name('Redis:' . $config['host'], $isMaster); - $this->getPool()->clean($coroutineName); + $this->getPool()->clean($config['host']); }