mirror of
https://github.com/redis/go-redis.git
synced 2025-07-29 17:41:15 +03:00
fix: late binding for dial hook
This commit is contained in:
10
ring.go
10
ring.go
@ -495,13 +495,13 @@ func NewRing(opt *RingOptions) *Ring {
|
||||
ring.cmdsInfoCache = newCmdsInfoCache(ring.cmdsInfo)
|
||||
ring.cmdable = ring.Process
|
||||
|
||||
ring.hooks.process = ring.process
|
||||
ring.hooks.processPipeline = func(ctx context.Context, cmds []Cmder) error {
|
||||
ring.hooks.setProcess(ring.process)
|
||||
ring.hooks.setProcessPipeline(func(ctx context.Context, cmds []Cmder) error {
|
||||
return ring.generalProcessPipeline(ctx, cmds, false)
|
||||
}
|
||||
ring.hooks.processTxPipeline = func(ctx context.Context, cmds []Cmder) error {
|
||||
})
|
||||
ring.hooks.setProcessTxPipeline(func(ctx context.Context, cmds []Cmder) error {
|
||||
return ring.generalProcessPipeline(ctx, cmds, true)
|
||||
}
|
||||
})
|
||||
|
||||
go ring.sharding.Heartbeat(hbCtx, opt.HeartbeatFrequency)
|
||||
|
||||
|
Reference in New Issue
Block a user