diff --git a/System/Cache/Redis.php b/System/Cache/Redis.php index dbf89a75..667311c8 100644 --- a/System/Cache/Redis.php +++ b/System/Cache/Redis.php @@ -47,20 +47,14 @@ class Redis extends Component */ public function createPool() { - try { - $connections = Snowflake::app()->pool->redis; + $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); - } catch (\Throwable $exception) { - var_dump($exception->getMessage()); - var_dump($exception->getFile()); - var_dump($exception->getLine()); - } + $connections->initConnections('redis:' . $name, true, $length); } diff --git a/System/Pool/Connection.php b/System/Pool/Connection.php index 71cae9cf..30d2d918 100644 --- a/System/Pool/Connection.php +++ b/System/Pool/Connection.php @@ -36,14 +36,20 @@ class Connection extends Pool */ public function Heartbeat_detection($timer) { - $this->creates = $timer; - if ($this->lastTime == 0) { - return; - } - if ($this->lastTime + 600 < time()) { - $this->flush(0); - } else if ($this->lastTime + 300 < time()) { - $this->flush(2); + try { + $this->creates = $timer; + if ($this->lastTime == 0) { + return; + } + if ($this->lastTime + 600 < time()) { + $this->flush(0); + } else if ($this->lastTime + 300 < time()) { + $this->flush(2); + } + } catch (\Throwable $exception) { + var_dump($exception->getMessage()); + var_dump($exception->getFile()); + var_dump($exception->getLine()); } }