@@ -386,7 +386,7 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error {
386
386
387
387
// for redis-server versions that do not support the HELLO command,
388
388
// RESP2 will continue to be used.
389
- if err = conn .Hello (ctx , c .opt .Protocol , username , password , c .opt .ClientName ).Err (); err == nil {
389
+ if err = conn .Hello (ctx , c .opt .Protocol , username , password , c .opt .ClientName ).Err (); err == nil {
390
390
// Authentication successful with HELLO command
391
391
} else if ! isRedisError (err ) {
392
392
// When the server responds with the RESP protocol and the result is not a normal
@@ -534,12 +534,6 @@ func (c *baseClient) _process(ctx context.Context, cmd Cmder, attempt int) (bool
534
534
readReplyFunc = cmd .readRawReply
535
535
}
536
536
if err := cn .WithReader (c .context (ctx ), c .cmdTimeout (cmd ), func (rd * proto.Reader ) error {
537
- // Check for push notifications before reading the command reply
538
- if c .opt .Protocol == 3 {
539
- if err := c .pushProcessor .ProcessPendingNotifications (ctx , rd ); err != nil {
540
- internal .Logger .Printf (ctx , "push: error processing push notifications: %v" , err )
541
- }
542
- }
543
537
return readReplyFunc (rd )
544
538
}); err != nil {
545
539
if cmd .readTimeout () == nil {
@@ -813,25 +807,25 @@ func (c *Client) Options() *Options {
813
807
814
808
// initializePushProcessor initializes the push notification processor for any client type.
815
809
// This is a shared helper to avoid duplication across NewClient, NewFailoverClient, and NewSentinelClient.
816
- func initializePushProcessor (opt * Options , useVoidByDefault bool ) PushNotificationProcessorInterface {
810
+ func initializePushProcessor (opt * Options ) PushNotificationProcessorInterface {
817
811
// Always use custom processor if provided
818
812
if opt .PushNotificationProcessor != nil {
819
813
return opt .PushNotificationProcessor
820
814
}
821
815
822
816
// For regular clients, respect the PushNotifications setting
823
- if ! useVoidByDefault && opt .PushNotifications {
817
+ if opt .PushNotifications {
824
818
// Create default processor when push notifications are enabled
825
819
return NewPushNotificationProcessor ()
826
820
}
827
821
828
- // Create void processor when push notifications are disabled or for specialized clients
822
+ // Create void processor when push notifications are disabled
829
823
return NewVoidPushNotificationProcessor ()
830
824
}
831
825
832
826
// initializePushProcessor initializes the push notification processor for this client.
833
827
func (c * Client ) initializePushProcessor () {
834
- c .pushProcessor = initializePushProcessor (c .opt , false )
828
+ c .pushProcessor = initializePushProcessor (c .opt )
835
829
}
836
830
837
831
// RegisterPushNotificationHandler registers a handler for a specific push notification name.
@@ -987,7 +981,7 @@ func newConn(opt *Options, connPool pool.Pooler, parentHooks *hooksMixin) *Conn
987
981
988
982
// Initialize push notification processor using shared helper
989
983
// Use void processor by default for connections (typically don't need push notifications)
990
- c .pushProcessor = initializePushProcessor (opt , true )
984
+ c .pushProcessor = initializePushProcessor (opt )
991
985
992
986
c .cmdable = c .Process
993
987
c .statefulCmdable = c .Process
0 commit comments