This commit is contained in:
2021-10-18 11:35:13 +08:00
parent 47be3285c5
commit ea5b473638
3 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -11,6 +11,7 @@ namespace Kiri\Cache;
use Annotation\Inject;
use Exception;
use Server\Events\OnAfterRequest;
use Server\Events\OnWorkerExit;
use Server\Events\OnWorkerStop;
use Kiri\Abstracts\Component;
@@ -48,6 +49,7 @@ class Redis extends Component
$length = Config::get('connections.pool.max', 10);
$this->eventProvider->on(OnAfterRequest::class, [$this, 'release'], 0);
$this->eventProvider->on(OnWorkerExit::class, [$this, 'destroy'], 0);
$connections->initConnections('Redis:' . $config['host'], true, $length);
@@ -67,7 +69,6 @@ class Redis extends Component
$data = $this->{$name}(...$arguments);
} else {
$data = $this->proxy()->{$name}(...$arguments);
$this->release();
}
if (microtime(true) - $time >= 0.02) {
$this->warning('Redis:' . Json::encode([$name, $arguments]) . (microtime(true) - $time));
+1 -1
View File
@@ -18,7 +18,7 @@ class Environmental
/**
* @return bool
*/
#[Pure] public function isMac(): bool
public function isMac(): bool
{
$output = strtolower(PHP_OS | PHP_OS_FAMILY);
if (str_contains('mac', $output)) {
+1
View File
@@ -132,6 +132,7 @@ class Pool extends Component
* @param $channel
* @return mixed
* @throws ConfigException
* @throws Exception
*/
private function maxIdleQuantity($channel): mixed
{