This commit is contained in:
2026-06-24 20:11:12 +08:00
parent 8479106b9f
commit 76351fbe66
4 changed files with 45 additions and 7 deletions
+5
View File
@@ -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());
}
}
}