mirror of
https://github.com/redis/go-redis.git
synced 2025-07-31 05:04:23 +03:00
Rework Options initialisation.
This commit is contained in:
3
ring.go
3
ring.go
@ -39,6 +39,8 @@ type RingOptions struct {
|
||||
IdleCheckFrequency time.Duration
|
||||
}
|
||||
|
||||
func (opt *RingOptions) init() {}
|
||||
|
||||
func (opt *RingOptions) clientOptions() *Options {
|
||||
return &Options{
|
||||
DB: opt.DB,
|
||||
@ -127,6 +129,7 @@ type Ring struct {
|
||||
|
||||
func NewRing(opt *RingOptions) *Ring {
|
||||
const nreplicas = 100
|
||||
opt.init()
|
||||
ring := &Ring{
|
||||
opt: opt,
|
||||
nreplicas: nreplicas,
|
||||
|
Reference in New Issue
Block a user