mirror of
https://github.com/redis/go-redis.git
synced 2025-07-18 00:20:57 +03:00
committed by
Vladimir Mihailenco
parent
3227091087
commit
97e6ed8178
9
ring.go
9
ring.go
@ -361,7 +361,8 @@ func NewRing(opt *RingOptions) *Ring {
|
||||
|
||||
ring.process = ring.defaultProcess
|
||||
ring.processPipeline = ring.defaultProcessPipeline
|
||||
ring.cmdable.setProcessor(ring.Process)
|
||||
|
||||
ring.init()
|
||||
|
||||
for name, addr := range opt.Addrs {
|
||||
clopt := opt.clientOptions()
|
||||
@ -374,6 +375,10 @@ func NewRing(opt *RingOptions) *Ring {
|
||||
return ring
|
||||
}
|
||||
|
||||
func (c *Ring) init() {
|
||||
c.cmdable.setProcessor(c.Process)
|
||||
}
|
||||
|
||||
func (c *Ring) Context() context.Context {
|
||||
if c.ctx != nil {
|
||||
return c.ctx
|
||||
@ -392,6 +397,8 @@ func (c *Ring) WithContext(ctx context.Context) *Ring {
|
||||
|
||||
func (c *Ring) clone() *Ring {
|
||||
cp := *c
|
||||
cp.init()
|
||||
|
||||
return &cp
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user