Skip to content

Commit 5f608ca

Browse files
committed
fix push processor exposed in opts
1 parent 3615779 commit 5f608ca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

redis.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,8 @@ func NewClient(opt *Options) *Client {
906906
if opt == nil {
907907
panic("redis: NewClient nil options")
908908
}
909+
// clone to not share options with the caller
910+
opt = opt.clone()
909911
opt.init()
910912

911913
// Push notifications are always enabled for RESP3 (cannot be disabled)
@@ -920,8 +922,8 @@ func NewClient(opt *Options) *Client {
920922
// Initialize push notification processor using shared helper
921923
// Use void processor for RESP2 connections (push notifications not available)
922924
c.pushProcessor = initializePushProcessor(opt)
923-
// Update options with the initialized push processor
924-
opt.PushNotificationProcessor = c.pushProcessor
925+
// set opt push processor for child clients
926+
c.opt.PushNotificationProcessor = c.pushProcessor
925927

926928
// Create connection pools
927929
var err error

0 commit comments

Comments
 (0)