1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

Ensure slots are initialised. Return non-failing connections to pool

This commit is contained in:
Dimitrij Denissenko
2015-04-13 14:33:44 +01:00
parent 9de2369192
commit 51f0a7b0a7
3 changed files with 21 additions and 5 deletions

View File

@ -56,8 +56,9 @@ func (c *baseClient) initConn(cn *conn) error {
func (c *baseClient) freeConn(cn *conn, ei error) error {
if cn.rd.Buffered() > 0 {
return c.connPool.Remove(cn)
}
if _, ok := ei.(redisError); ok {
} else if ei == nil {
return c.connPool.Put(cn)
} else if _, ok := ei.(redisError); ok {
return c.connPool.Put(cn)
}
return c.connPool.Remove(cn)