Merge pull request #554 from go-redis/fix/close-pubsub-conn

Fix/close pubsub conn
This commit is contained in:
Vladimir Mihailenco 2017-04-24 14:22:38 +03:00 committed by GitHub
commit d0dd05b659
1 changed files with 2 additions and 1 deletions

View File

@ -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
}