1
0

Update module go-redis/redis/v7 to v7.3.0 (#565)

Update module go-redis/redis/v7 to v7.3.0

Reviewed-on: https://kolaente.dev/vikunja/api/pulls/565
This commit is contained in:
renovate
2020-05-21 08:56:39 +00:00
committed by konrad
parent cc47d11792
commit b0948a37d4
20 changed files with 96 additions and 12 deletions

View File

@ -57,6 +57,7 @@ type ClusterOptions struct {
OnConnect func(*Conn) error
Username string
Password string
MaxRetries int
@ -67,6 +68,9 @@ type ClusterOptions struct {
ReadTimeout time.Duration
WriteTimeout time.Duration
// NewClient creates a cluster node client with provided name and options.
NewClient func(opt *Options) *Client
// PoolSize applies per cluster node and not for the whole cluster.
PoolSize int
MinIdleConns int
@ -118,6 +122,10 @@ func (opt *ClusterOptions) init() {
case 0:
opt.MaxRetryBackoff = 512 * time.Millisecond
}
if opt.NewClient == nil {
opt.NewClient = NewClient
}
}
func (opt *ClusterOptions) clientOptions() *Options {
@ -130,6 +138,7 @@ func (opt *ClusterOptions) clientOptions() *Options {
MaxRetries: opt.MaxRetries,
MinRetryBackoff: opt.MinRetryBackoff,
MaxRetryBackoff: opt.MaxRetryBackoff,
Username: opt.Username,
Password: opt.Password,
readOnly: opt.ReadOnly,
@ -162,7 +171,7 @@ func newClusterNode(clOpt *ClusterOptions, addr string) *clusterNode {
opt := clOpt.clientOptions()
opt.Addr = addr
node := clusterNode{
Client: NewClient(opt),
Client: clOpt.NewClient(opt),
}
node.latency = math.MaxUint32