1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

fix: address pr review

This commit is contained in:
Nedyalko Dyakov
2025-06-27 18:07:13 +03:00
parent 075b9309c6
commit f7948b5c5c
6 changed files with 61 additions and 77 deletions

View File

@ -431,14 +431,9 @@ func NewFailoverClient(failoverOpt *FailoverOptions) *Client {
}
rdb.init()
// Initialize push notification processor similar to regular client
if opt.PushNotificationProcessor != nil {
rdb.pushProcessor = opt.PushNotificationProcessor
} else if opt.PushNotifications {
rdb.pushProcessor = NewPushNotificationProcessor()
} else {
rdb.pushProcessor = NewVoidPushNotificationProcessor()
}
// Initialize push notification processor using shared helper
// Use void processor by default for failover clients (typically don't need push notifications)
rdb.pushProcessor = initializePushProcessor(opt, true)
connPool = newConnPool(opt, rdb.dialHook)
rdb.connPool = connPool
@ -506,14 +501,9 @@ func NewSentinelClient(opt *Options) *SentinelClient {
},
}
// Initialize push notification processor similar to regular client
if opt.PushNotificationProcessor != nil {
c.pushProcessor = opt.PushNotificationProcessor
} else if opt.PushNotifications {
c.pushProcessor = NewPushNotificationProcessor()
} else {
c.pushProcessor = NewVoidPushNotificationProcessor()
}
// Initialize push notification processor using shared helper
// Use void processor by default for sentinel clients (typically don't need push notifications)
c.pushProcessor = initializePushProcessor(opt, true)
c.initHooks(hooks{
dial: c.baseClient.dial,