Remove old connection from pool on close (GetOneOf)

This commit is contained in:
mcrakhman 2023-03-13 17:18:21 +01:00 committed by Mikhail Iudin
parent df867395ae
commit ab3a8e2bcd
No known key found for this signature in database
GPG Key ID: FAAAA8BAABDFF1C0

View File

@ -67,6 +67,7 @@ func (p *pool) GetOneOf(ctx context.Context, peerIds []string) (peer.Peer, error
default: default:
return pr, nil return pr, nil
} }
_, _ = p.cache.Remove(ctx, peerId)
} }
} }
// shuffle ids for better consistency // shuffle ids for better consistency