1
0
mirror of https://github.com/redis/go-redis.git synced 2025-06-14 01:21:30 +03:00

Faster and simpler pool.

This commit is contained in:
Vladimir Mihailenco
2016-03-17 18:00:47 +02:00
parent 93a7fe0de3
commit 6e1aef39ea
22 changed files with 418 additions and 492 deletions

View File

@ -39,7 +39,7 @@ func (c *baseClient) conn() (*pool.Conn, error) {
}
if !cn.Inited {
if err := c.initConn(cn); err != nil {
_ = c.connPool.Replace(cn, err)
_ = c.connPool.Remove(cn, err)
return nil, err
}
}
@ -48,7 +48,7 @@ func (c *baseClient) conn() (*pool.Conn, error) {
func (c *baseClient) putConn(cn *pool.Conn, err error, allowTimeout bool) bool {
if isBadConn(err, allowTimeout) {
_ = c.connPool.Replace(cn, err)
_ = c.connPool.Remove(cn, err)
return false
}