getRedisFromPool(); $config = $this->get_config(); $name = $config['host'] . ':' . $config['prefix'] . ':' . $config['databases']; $length = env('REDIS.POOL_LENGTH', 100); $connections->initConnections('redis', 'redis:' . $name, 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->debug('Redis:' . Json::encode([$name, $arguments])); } return $data; } /** * @param $key * @param int $timeout * @return bool|int * @throws Exception */ public function lock($key, int $timeout = 5): bool|int { $script = <<