Skip to content

Commit 59da35b

Browse files
committed
improve remove conn
1 parent 2965e3d commit 59da35b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

internal/pool/pool.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,8 +800,7 @@ func (p *ConnPool) removeConn(cn *Conn) {
800800
p.poolSize.Add(-1)
801801
// this can be idle conn
802802
for idx, ic := range p.idleConns {
803-
if ic.GetID() == cid {
804-
internal.Logger.Printf(context.Background(), "redis: connection pool: removing idle conn[%d]", cid)
803+
if ic == cn {
805804
p.idleConns = append(p.idleConns[:idx], p.idleConns[idx+1:]...)
806805
p.idleConnsLen.Add(-1)
807806
break

0 commit comments

Comments
 (0)