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:
5
redis.go
5
redis.go
@ -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)
|
||||
|
Reference in New Issue
Block a user