Skip to content

Commit be3a6c6

Browse files
committed
fix(push): address comments
1 parent 1d204c2 commit be3a6c6

File tree

3 files changed

+3
-17
lines changed

3 files changed

+3
-17
lines changed

internal/pool/pool.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ func (p *ConnPool) dialConn(ctx context.Context, pooled bool) (*Conn, error) {
232232

233233
cn := NewConn(netConn)
234234
cn.pooled = pooled
235-
236235
return cn, nil
237236
}
238237

push/errors.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,3 @@ func IsVoidProcessorError(err error) bool {
140140
}
141141
return false
142142
}
143-
144-
// extractNotificationName attempts to extract the notification name from error messages
145-
func extractNotificationName(err error) string {
146-
if handlerErr, ok := err.(*HandlerError); ok {
147-
if handlerErr.PushNotificationName != "" {
148-
return handlerErr.PushNotificationName
149-
}
150-
}
151-
if procErr, ok := err.(*ProcessorError); ok {
152-
if procErr.PushNotificationName != "" {
153-
return procErr.PushNotificationName
154-
}
155-
}
156-
return "unknown"
157-
}

redis.go

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

0 commit comments

Comments
 (0)