作者 邓超

优化

@@ -307,6 +307,13 @@ end", @@ -307,6 +307,13 @@ end",
307 if(empty(static::$instance[$cid])){ 307 if(empty(static::$instance[$cid])){
308 static::$instance[$cid] = new \Lib\RedisPool($cid); 308 static::$instance[$cid] = new \Lib\RedisPool($cid);
309 } 309 }
  310 + try {
  311 + static::$instance[$cid]->client->ping();
  312 + }catch (\Throwable $e){
  313 + static::$instance[$cid]->close();
  314 +
  315 + static::$instance[$cid] = new \Lib\RedisPool($cid);
  316 + }
310 317
311 return static::$instance[$cid]; 318 return static::$instance[$cid];
312 } 319 }