diff --git a/System/Pool/Connection.php b/System/Pool/Connection.php index 2edf4293..a9f988ed 100644 --- a/System/Pool/Connection.php +++ b/System/Pool/Connection.php @@ -175,6 +175,7 @@ class Connection extends Pool $client->commit(); } $this->push($coroutineName, $client); + Context::remove($coroutineName); $this->lastTime = time(); } @@ -231,6 +232,7 @@ class Connection extends Pool */ public function disconnect($coroutineName, bool $isMaster = false) { + Context::remove($coroutineName); $coroutineName = $this->name($coroutineName, $isMaster); $this->clean($coroutineName); } diff --git a/System/Pool/Redis.php b/System/Pool/Redis.php index 00749302..d0abb979 100644 --- a/System/Pool/Redis.php +++ b/System/Pool/Redis.php @@ -51,7 +51,7 @@ class Redis extends Pool * @return mixed * @throws Exception */ - public function get(mixed $config, $isMaster = false): mixed + public function get(mixed $config, bool $isMaster = false): mixed { $name = $config['host'] . ':' . $config['prefix'] . ':' . $config['databases']; $coroutineName = $this->name('redis', 'redis:' . $name, $isMaster); @@ -98,7 +98,7 @@ class Redis extends Pool * @param array $config * @param bool $isMaster */ - public function release(array $config, $isMaster = false) + public function release(array $config, bool $isMaster = false) { $name = $config['host'] . ':' . $config['prefix'] . ':' . $config['databases']; $coroutineName = $this->name('redis', 'redis:' . $name, $isMaster); @@ -116,7 +116,7 @@ class Redis extends Pool * @param bool $isMaster * @throws Exception */ - public function destroy(array $config, $isMaster = false) + public function destroy(array $config, bool $isMaster = false) { $name = $config['host'] . ':' . $config['prefix'] . ':' . $config['databases']; $coroutineName = $this->name('redis', 'redis:' . $name, $isMaster);