From 13b6f3ffb7d990e6774067abedeac598a50f8f20 Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Mon, 24 Apr 2017 14:00:28 +0300 Subject: [PATCH] Fix conn management in PubSub --- pubsub.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pubsub.go b/pubsub.go index 3680323..b9d5c60 100644 --- a/pubsub.go +++ b/pubsub.go @@ -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 }