Closed hy05190134 closed 7 years ago
You can manually call ping if you're worried about it. However note that commit b6e7358 made Pool do a PING on every connection periodically automatically, so Pool should no longer need manual pinging to keep connections from timing out. Since sentinel uses Pool internally this also applies to the sentinel client (and cluster as well, if you ever want to use that).
So the short answer is: You shouldn't need to manually call PING anymore, but it won't hurt if you want to.
@mediocregopher thanks
when I use GetMaster to get a conn, I worry about whether the conn will be not alive for my redis server also has timeout for idle, and the problem exists in the pool client usage, and you suggest to use PING to solve the problem. Is it the same to Ping for the conn returned by GetMaster