1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00
This commit is contained in:
Vladimir Mihailenco
2019-06-14 16:00:03 +03:00
parent c0e70ad31d
commit 880e05d975
7 changed files with 15 additions and 22 deletions

View File

@ -139,8 +139,8 @@ func (c *baseClient) String() string {
return fmt.Sprintf("Redis<%s db:%d>", c.getAddr(), c.opt.DB)
}
func (c *baseClient) newConn() (*pool.Conn, error) {
cn, err := c.connPool.NewConn()
func (c *baseClient) newConn(ctx context.Context) (*pool.Conn, error) {
cn, err := c.connPool.NewConn(ctx)
if err != nil {
return nil, err
}
@ -581,7 +581,7 @@ func (c *Client) pubSub() *PubSub {
opt: c.opt,
newConn: func(channels []string) (*pool.Conn, error) {
return c.newConn()
return c.newConn(context.TODO())
},
closeConn: c.connPool.CloseConn,
}