mirror of
https://github.com/redis/go-redis.git
synced 2025-07-29 17:41:15 +03:00
Rework Options initialisation.
This commit is contained in:
@ -64,12 +64,15 @@ func (opt *FailoverOptions) options() *Options {
|
||||
// goroutines.
|
||||
func NewFailoverClient(failoverOpt *FailoverOptions) *Client {
|
||||
opt := failoverOpt.options()
|
||||
opt.init()
|
||||
|
||||
failover := &sentinelFailover{
|
||||
masterName: failoverOpt.MasterName,
|
||||
sentinelAddrs: failoverOpt.SentinelAddrs,
|
||||
|
||||
opt: opt,
|
||||
}
|
||||
|
||||
client := Client{
|
||||
baseClient: baseClient{
|
||||
opt: opt,
|
||||
@ -81,6 +84,7 @@ func NewFailoverClient(failoverOpt *FailoverOptions) *Client {
|
||||
},
|
||||
}
|
||||
client.cmdable.process = client.Process
|
||||
|
||||
return &client
|
||||
}
|
||||
|
||||
@ -92,6 +96,7 @@ type sentinelClient struct {
|
||||
}
|
||||
|
||||
func newSentinel(opt *Options) *sentinelClient {
|
||||
opt.init()
|
||||
client := sentinelClient{
|
||||
baseClient: baseClient{
|
||||
opt: opt,
|
||||
|
Reference in New Issue
Block a user