1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-31 05:04:23 +03:00

fix(push): address comments

This commit is contained in:
Nedyalko Dyakov
2025-07-16 18:25:22 +03:00
parent 1d204c2fe7
commit be3a6c6216
3 changed files with 3 additions and 17 deletions

View File

@ -232,7 +232,6 @@ func (p *ConnPool) dialConn(ctx context.Context, pooled bool) (*Conn, error) {
cn := NewConn(netConn)
cn.pooled = pooled
return cn, nil
}

View File

@ -140,18 +140,3 @@ func IsVoidProcessorError(err error) bool {
}
return false
}
// extractNotificationName attempts to extract the notification name from error messages
func extractNotificationName(err error) string {
if handlerErr, ok := err.(*HandlerError); ok {
if handlerErr.PushNotificationName != "" {
return handlerErr.PushNotificationName
}
}
if procErr, ok := err.(*ProcessorError); ok {
if procErr.PushNotificationName != "" {
return procErr.PushNotificationName
}
}
return "unknown"
}

View File

@ -1103,7 +1103,9 @@ func (c *baseClient) processPushNotifications(ctx context.Context, cn *pool.Conn
// Use WithReader to access the reader and process push notifications
// This is critical for hitless upgrades to work properly
// NOTE: almost no timeouts are set for this read, so it should not block
return cn.WithReader(ctx, 1, func(rd *proto.Reader) error {
// longer than necessary, 50us should be plenty of time to read if there are any push notifications
// on the socket
return cn.WithReader(ctx, 50*time.Microsecond, func(rd *proto.Reader) error {
// Create handler context with client, connection pool, and connection information
handlerCtx := c.pushNotificationHandlerContext(cn)
return c.pushProcessor.ProcessPendingNotifications(ctx, handlerCtx, rd)