forked from mirror/redis
Merge pull request #554 from go-redis/fix/close-pubsub-conn
Fix/close pubsub conn
This commit is contained in:
commit
d0dd05b659
|
@ -46,12 +46,13 @@ func (c *PubSub) conn() (*pool.Conn, bool, error) {
|
|||
|
||||
if !cn.Inited {
|
||||
if err := c.base.initConn(cn); err != nil {
|
||||
_ = c.base.connPool.Remove(cn)
|
||||
_ = c.base.connPool.CloseConn(cn)
|
||||
return nil, false, err
|
||||
}
|
||||
}
|
||||
|
||||
if err := c.resubscribe(cn); err != nil {
|
||||
_ = c.base.connPool.CloseConn(cn)
|
||||
return nil, false, err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue