mirror of
https://github.com/redis/go-redis.git
synced 2025-07-31 05:04:23 +03:00
Pass context to Dialer
This commit is contained in:
12
sentinel.go
12
sentinel.go
@ -21,16 +21,16 @@ type FailoverOptions struct {
|
||||
// The master name.
|
||||
MasterName string
|
||||
// A seed list of host:port addresses of sentinel nodes.
|
||||
SentinelAddrs []string
|
||||
SentinelAddrs []string
|
||||
SentinelPassword string
|
||||
|
||||
// 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
|
||||
|
||||
Password string
|
||||
SentinelPassword string
|
||||
DB int
|
||||
Password string
|
||||
DB int
|
||||
|
||||
MaxRetries int
|
||||
MinRetryBackoff time.Duration
|
||||
@ -312,7 +312,7 @@ func (c *sentinelFailover) Pool() *pool.ConnPool {
|
||||
return c.pool
|
||||
}
|
||||
|
||||
func (c *sentinelFailover) dial(network, addr string) (net.Conn, error) {
|
||||
func (c *sentinelFailover) dial(ctx context.Context, network, addr string) (net.Conn, error) {
|
||||
addr, err := c.MasterAddr()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user