mirror of
https://github.com/redis/go-redis.git
synced 2025-07-31 05:04:23 +03:00
feat: fix connection health check interference with push notifications
- Add PushNotificationProcessor field to pool.Conn for connection-level processing - Modify connection pool Put() and isHealthyConn() to handle push notifications - Process pending push notifications before discarding connections - Pass push notification processor to connections during creation - Update connection pool options to include push notification processor - Add comprehensive test for connection health check integration This prevents connections with buffered push notification data from being incorrectly discarded by the connection health check, ensuring push notifications are properly processed and connections are reused.
This commit is contained in:
@ -25,6 +25,12 @@ type Conn struct {
|
||||
createdAt time.Time
|
||||
|
||||
onClose func() error
|
||||
|
||||
// Push notification processor for handling push notifications on this connection
|
||||
PushNotificationProcessor interface {
|
||||
IsEnabled() bool
|
||||
ProcessPendingNotifications(ctx context.Context, rd *proto.Reader) error
|
||||
}
|
||||
}
|
||||
|
||||
func NewConn(netConn net.Conn) *Conn {
|
||||
|
Reference in New Issue
Block a user