This commit is contained in:
as2252258@163.com
2021-07-03 12:57:06 +08:00
parent 4096050303
commit d7b84a804d
3 changed files with 201 additions and 200 deletions
+3 -6
View File
@@ -53,8 +53,7 @@ class Redis extends Pool
*/
public function get(mixed $config, bool $isMaster = false): mixed
{
$name = $config['host'] . ':' . $config['prefix'] . ':' . $config['databases'];
$coroutineName = $this->name('redis', 'redis:' . $name, $isMaster);
$coroutineName = $this->name('redis', 'redis:' . $config['host'], $isMaster);
if (!Context::hasContext($coroutineName)) {
return Context::setContext($coroutineName, $this->getFromChannel($coroutineName, $config));
}
@@ -100,8 +99,7 @@ class Redis extends Pool
*/
public function release(array $config, bool $isMaster = false)
{
$name = $config['host'] . ':' . $config['prefix'] . ':' . $config['databases'];
$coroutineName = $this->name('redis', 'redis:' . $name, $isMaster);
$coroutineName = $this->name('redis', 'redis:' . $config['host'], $isMaster);
if (!Context::hasContext($coroutineName)) {
return;
}
@@ -118,8 +116,7 @@ class Redis extends Pool
*/
public function destroy(array $config, bool $isMaster = false)
{
$name = $config['host'] . ':' . $config['prefix'] . ':' . $config['databases'];
$coroutineName = $this->name('redis', 'redis:' . $name, $isMaster);
$coroutineName = $this->name('redis', 'redis:' . $config['host'], $isMaster);
if (Context::hasContext($coroutineName)) {
$this->decrement($coroutineName);
}