mirror of
https://github.com/redis/go-redis.git
synced 2025-07-20 22:42:59 +03:00
fix(auth): don't double close the conn
This commit is contained in:
4
redis.go
4
redis.go
@ -317,8 +317,7 @@ func (c *baseClient) onAuthenticationErr(ctx context.Context, cn *Conn) func(err
|
||||
poolCn, getErr := cn.connPool.Get(ctx)
|
||||
if getErr == nil {
|
||||
c.connPool.Remove(ctx, poolCn, err)
|
||||
}
|
||||
|
||||
} else {
|
||||
// if we can't get the pool connection, we can only close the connection
|
||||
if err := cn.Close(); err != nil {
|
||||
log.Printf("failed to close connection: %v", err)
|
||||
@ -326,6 +325,7 @@ func (c *baseClient) onAuthenticationErr(ctx context.Context, cn *Conn) func(err
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (c *baseClient) wrappedOnClose(newOnClose func() error) func() error {
|
||||
|
Reference in New Issue
Block a user