Skip to content

Commit

Permalink
Merge pull request redis#551 from go-redis/fix/init-pubsub
Browse files Browse the repository at this point in the history
Initialize PubSub connection
  • Loading branch information
vmihailenco authored Apr 18, 2017
2 parents 4fdc3bb + 7646d48 commit 15786cf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
1 change: 1 addition & 0 deletions redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func (c *baseClient) conn() (*pool.Conn, bool, error) {
return nil, false, err
}
}

return cn, isNew, nil
}

Expand Down

0 comments on commit 15786cf

Please sign in to comment.