diff --git a/System/Cache/Redis.php b/System/Cache/Redis.php index 667311c8..dbf89a75 100644 --- a/System/Cache/Redis.php +++ b/System/Cache/Redis.php @@ -47,14 +47,20 @@ class Redis extends Component */ public function createPool() { - $connections = Snowflake::app()->pool->redis; + try { + $connections = Snowflake::app()->pool->redis; - $config = $this->get_config(); - $name = $config['host'] . ':' . $config['prefix'] . ':' . $config['databases']; + $config = $this->get_config(); + $name = $config['host'] . ':' . $config['prefix'] . ':' . $config['databases']; - $length = env('REDIS.POOL_LENGTH', 100); + $length = env('REDIS.POOL_LENGTH', 100); - $connections->initConnections('redis:' . $name, true, $length); + $connections->initConnections('redis:' . $name, true, $length); + } catch (\Throwable $exception) { + var_dump($exception->getMessage()); + var_dump($exception->getFile()); + var_dump($exception->getLine()); + } } diff --git a/System/Pool/Connection.php b/System/Pool/Connection.php index 58360ebb..71cae9cf 100644 --- a/System/Pool/Connection.php +++ b/System/Pool/Connection.php @@ -413,7 +413,7 @@ class Connection extends Pool public function desc(string $name) { if (!isset($this->hasCreate[$name])) { - return; + $this->hasCreate[$name] = 0; } $this->hasCreate[$name] -= 1; }