mirror of
https://github.com/redis/go-redis.git
synced 2025-12-25 00:01:00 +03:00
feat(options): Clean failing timeout implementation (#3472)
* Fix hard code of failing timeout 1. if not set failing time limit, default is 15 seconds. * feat: Complete configurable FailingTimeoutSeconds implementation --------- Co-authored-by: Shino Wu <shino_wu@trendmicro.com>
This commit is contained in:
16
sentinel.go
16
sentinel.go
@@ -129,7 +129,13 @@ type FailoverOptions struct {
|
||||
DisableIdentity bool
|
||||
|
||||
IdentitySuffix string
|
||||
UnstableResp3 bool
|
||||
|
||||
// FailingTimeoutSeconds is the timeout in seconds for marking a cluster node as failing.
|
||||
// When a node is marked as failing, it will be avoided for this duration.
|
||||
// Only applies to failover cluster clients. Default is 15 seconds.
|
||||
FailingTimeoutSeconds int
|
||||
|
||||
UnstableResp3 bool
|
||||
}
|
||||
|
||||
func (opt *FailoverOptions) clientOptions() *Options {
|
||||
@@ -263,10 +269,10 @@ func (opt *FailoverOptions) clusterOptions() *ClusterOptions {
|
||||
|
||||
TLSConfig: opt.TLSConfig,
|
||||
|
||||
DisableIdentity: opt.DisableIdentity,
|
||||
DisableIndentity: opt.DisableIndentity,
|
||||
|
||||
IdentitySuffix: opt.IdentitySuffix,
|
||||
DisableIdentity: opt.DisableIdentity,
|
||||
DisableIndentity: opt.DisableIndentity,
|
||||
IdentitySuffix: opt.IdentitySuffix,
|
||||
FailingTimeoutSeconds: opt.FailingTimeoutSeconds,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user