mirror of
https://github.com/redis/go-redis.git
synced 2025-08-08 23:42:06 +03:00
Pass context to Dialer
This commit is contained in:
@@ -53,7 +53,7 @@ type ClusterOptions struct {
|
||||
|
||||
// Following options are copied from Options struct.
|
||||
|
||||
Dialer func(network, addr string) (net.Conn, error)
|
||||
Dialer func(ctx context.Context, network, addr string) (net.Conn, error)
|
||||
|
||||
OnConnect func(*Conn) error
|
||||
|
||||
@@ -1055,7 +1055,7 @@ func (c *ClusterClient) _processPipeline(ctx context.Context, cmds []Cmder) erro
|
||||
go func(node *clusterNode, cmds []Cmder) {
|
||||
defer wg.Done()
|
||||
|
||||
cn, err := node.Client.getConn()
|
||||
cn, err := node.Client.getConn(ctx)
|
||||
if err != nil {
|
||||
if err == pool.ErrClosed {
|
||||
c.mapCmdsByNode(cmds, failedCmds)
|
||||
@@ -1256,7 +1256,7 @@ func (c *ClusterClient) _processTxPipeline(ctx context.Context, cmds []Cmder) er
|
||||
go func(node *clusterNode, cmds []Cmder) {
|
||||
defer wg.Done()
|
||||
|
||||
cn, err := node.Client.getConn()
|
||||
cn, err := node.Client.getConn(ctx)
|
||||
if err != nil {
|
||||
if err == pool.ErrClosed {
|
||||
c.mapCmdsByNode(cmds, failedCmds)
|
||||
|
Reference in New Issue
Block a user