This commit is contained in:
2020-09-11 01:26:36 +08:00
parent 9df3b56ec0
commit 00d64ec73d
-3
View File
@@ -40,7 +40,6 @@ class Redis extends Pool
if (Context::hasContext($coroutineName)) { if (Context::hasContext($coroutineName)) {
return Context::getContext($coroutineName); return Context::getContext($coroutineName);
} else if (!$this->hasItem($coroutineName)) { } else if (!$this->hasItem($coroutineName)) {
$this->success('create redis client -> ' . $config['host'] . ':' . $this->size($coroutineName));
return $this->saveClient($coroutineName, $this->createConnect($config)); return $this->saveClient($coroutineName, $this->createConnect($config));
} }
return $this->getByChannel($coroutineName, $config); return $this->getByChannel($coroutineName, $config);
@@ -55,9 +54,7 @@ class Redis extends Pool
*/ */
public function getByChannel($coroutineName, $config) public function getByChannel($coroutineName, $config)
{ {
$this->info('redis client has :' . $this->size($coroutineName));
if (!$this->hasItem($coroutineName)) { if (!$this->hasItem($coroutineName)) {
$this->success('create redis client -> ' . $config['host'] . ':' . $this->size($coroutineName));
return $this->saveClient($coroutineName, $this->createConnect($config)); return $this->saveClient($coroutineName, $this->createConnect($config));
} }
[$time, $client] = $this->get($coroutineName); [$time, $client] = $this->get($coroutineName);