getRedisFromPool(); $config = $this->get_config(); $length = (int)env('REDIS.POOL_LENGTH', 100); $connections->initConnections('Redis:' . $config['host'], true, $length); } /** * @param $name * @param $arguments * @return mixed * @throws */ public function __call($name, $arguments): mixed { $time = microtime(true); if (method_exists($this, $name)) { $data = $this->{$name}(...$arguments); } else { $data = $this->proxy()->{$name}(...$arguments); } if (microtime(true) - $time >= 0.02) { $this->warning('Redis:' . Json::encode([$name, $arguments]) . (microtime(true) - $time)); } return $data; } /** * @param $key * @param int $timeout * @return bool|int * @throws Exception */ public function lock($key, int $timeout = 5): bool|int { $script = <<