This commit is contained in:
2021-02-20 12:30:35 +08:00
parent 2fdefb43c9
commit 4ab5ccae8f
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -44,8 +44,8 @@ class Redis extends Pool
{
$name = $config['host'] . ':' . $config['prefix'] . ':' . $config['databases'];
$coroutineName = $this->name('redis:' . $name, $isMaster);
if (Context::hasContext($coroutineName)) {
return Context::getContext($coroutineName);
if (($redis = Context::getContext($coroutineName)) instanceof \Redis) {
return $redis;
}
if (!$this->hasItem($coroutineName)) {
$this->newClient($config, $coroutineName);