debug alter
This commit is contained in:
@@ -84,7 +84,6 @@ class Redis extends Component
|
|||||||
} else {
|
} else {
|
||||||
$data = $this->proxy($name, $arguments);
|
$data = $this->proxy($name, $arguments);
|
||||||
}
|
}
|
||||||
$this->logger->debug('Redis:' . Json::encode([$name, $arguments]) . (microtime(true) - $time));
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,11 +167,14 @@ SCRIPT;
|
|||||||
public function proxy($name, $arguments): mixed
|
public function proxy($name, $arguments): mixed
|
||||||
{
|
{
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
|
$time = time();
|
||||||
try {
|
try {
|
||||||
$response = $client->{$name}(...$arguments);
|
$response = $client->{$name}(...$arguments);
|
||||||
} catch (\Throwable $throwable) {
|
} catch (\Throwable $throwable) {
|
||||||
$response = $this->logger->addError($throwable->getMessage());
|
$response = $this->logger->addError($throwable->getMessage());
|
||||||
} finally {
|
} finally {
|
||||||
|
$this->logger->debug('Redis:' . Json::encode([$name, $arguments]) . (microtime(true) - $time));
|
||||||
|
|
||||||
$this->pool->push($this->get_config()['host'], $client);
|
$this->pool->push($this->get_config()['host'], $client);
|
||||||
}
|
}
|
||||||
return $response;
|
return $response;
|
||||||
|
|||||||
Reference in New Issue
Block a user