mediocregopher / radix.v2

Redis client for Go
http://godoc.org/github.com/mediocregopher/radix.v2
MIT License
433 stars 92 forks source link

sentinel conn alive problem #64

Closed hy05190134 closed 7 years ago

hy05190134 commented 7 years ago

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

mediocregopher commented 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.

hy05190134 commented 7 years ago

@mediocregopher thanks