This commit is contained in:
as2252258@163.com
2021-05-04 03:07:11 +08:00
parent 6230db7a4f
commit a8eebeb902
4 changed files with 19 additions and 18 deletions
+3 -3
View File
@@ -53,10 +53,10 @@ class Redis extends Pool
{
$name = $config['host'] . ':' . $config['prefix'] . ':' . $config['databases'];
$coroutineName = $this->name('redis', 'redis:' . $name, $isMaster);
if (($redis = Context::getContext($coroutineName)) instanceof \Redis) {
return $redis;
if (!Context::hasContext($coroutineName)) {
return Context::setContext($coroutineName, $this->getFromChannel($coroutineName, $config));
}
return Context::setContext($coroutineName, $this->getFromChannel($coroutineName, $config));
return Context::getContext($coroutineName);
}