eee
This commit is contained in:
@@ -136,6 +136,8 @@ class Redis
|
||||
|
||||
|
||||
/**
|
||||
* 代理 Redis 方法调用,内置健康检查和连接回收
|
||||
* 如果连接 ping 失败则关闭连接并移除,不归还池中防止污染
|
||||
* @param $name
|
||||
* @param $arguments
|
||||
* @return mixed
|
||||
@@ -151,6 +153,9 @@ class Redis
|
||||
} finally {
|
||||
if ($client->ping('h') == 'h') {
|
||||
$this->pool()->push($this->getName(), $client);
|
||||
} else {
|
||||
$client->close();
|
||||
$this->pool()->abandon($this->getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user