forked from mirror/redis
Initialize PubSub connection
This commit is contained in:
parent
4fdc3bb9f9
commit
7646d48e29
|
@ -78,8 +78,15 @@ func (c *PubSub) _conn() (*pool.Conn, bool, error) {
|
|||
if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
c.cn = cn
|
||||
|
||||
if !cn.Inited {
|
||||
if err := c.base.initConn(cn); err != nil {
|
||||
_ = c.base.connPool.Remove(cn)
|
||||
return nil, false, err
|
||||
}
|
||||
}
|
||||
|
||||
c.cn = cn
|
||||
return cn, true, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue