forked from mirror/redis
Disable idle checks for cluster connection
This commit is contained in:
parent
938235994e
commit
8f5aeb7065
|
@ -627,6 +627,8 @@ func (opt *ClusterOptions) init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opt *ClusterOptions) clientOptions() *Options {
|
func (opt *ClusterOptions) clientOptions() *Options {
|
||||||
|
const disableIdleCheck = -1
|
||||||
|
|
||||||
return &Options{
|
return &Options{
|
||||||
Password: opt.Password,
|
Password: opt.Password,
|
||||||
ReadOnly: opt.ReadOnly,
|
ReadOnly: opt.ReadOnly,
|
||||||
|
@ -640,5 +642,6 @@ func (opt *ClusterOptions) clientOptions() *Options {
|
||||||
IdleTimeout: opt.IdleTimeout,
|
IdleTimeout: opt.IdleTimeout,
|
||||||
|
|
||||||
// IdleCheckFrequency is not copied to disable reaper
|
// IdleCheckFrequency is not copied to disable reaper
|
||||||
|
IdleCheckFrequency: disableIdleCheck,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,7 @@ type Options struct {
|
||||||
IdleTimeout time.Duration
|
IdleTimeout time.Duration
|
||||||
// Frequency of idle checks.
|
// Frequency of idle checks.
|
||||||
// Default is 1 minute.
|
// Default is 1 minute.
|
||||||
|
// When minus value is set, then idle check is disabled.
|
||||||
IdleCheckFrequency time.Duration
|
IdleCheckFrequency time.Duration
|
||||||
|
|
||||||
// Enables read only queries on slave nodes.
|
// Enables read only queries on slave nodes.
|
||||||
|
|
Loading…
Reference in New Issue