1
0
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:
ofekshenawa
2025-08-12 14:08:28 +03:00
committed by GitHub
parent 6220024a38
commit 436979f5c7
5 changed files with 130 additions and 25 deletions

View File

@@ -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,
}
}