modify plugin name

This commit is contained in:
2022-02-24 13:53:03 +08:00
parent f59e2870c0
commit d5293f28b7
+5 -7
View File
@@ -30,7 +30,7 @@ class Redis extends Component
*/ */
public function get(mixed $config, bool $isMaster = false): mixed public function get(mixed $config, bool $isMaster = false): mixed
{ {
$coroutineName = $this->name('Redis:' . $config['host'], $isMaster); $coroutineName = $config['host'];
if (Context::hasContext($coroutineName)) { if (Context::hasContext($coroutineName)) {
return Context::getContext($coroutineName); return Context::getContext($coroutineName);
} }
@@ -63,7 +63,7 @@ class Redis extends Component
*/ */
public function release(array $config, bool $isMaster = false) public function release(array $config, bool $isMaster = false)
{ {
$coroutineName = $this->name('Redis:' . $config['host'], $isMaster); $coroutineName = $config['host'];
if (!Context::hasContext($coroutineName)) { if (!Context::hasContext($coroutineName)) {
return; return;
} }
@@ -79,9 +79,8 @@ class Redis extends Component
*/ */
public function destroy(array $config, bool $isMaster = false) public function destroy(array $config, bool $isMaster = false)
{ {
$coroutineName = $this->name('Redis:' . $config['host'], $isMaster); $this->getPool()->clean($config['host']);
$this->getPool()->clean($coroutineName); Context::remove($config['host']);
Context::remove($coroutineName);
} }
@@ -92,8 +91,7 @@ class Redis extends Component
*/ */
public function connection_clear(array $config, bool $isMaster = false) public function connection_clear(array $config, bool $isMaster = false)
{ {
$coroutineName = $this->name('Redis:' . $config['host'], $isMaster); $this->getPool()->clean($config['host']);
$this->getPool()->clean($coroutineName);
} }