MCPcopy
hub / github.com/redis/go-redis / enableMaintNotificationsUpgrades

Method enableMaintNotificationsUpgrades

redis.go:1051–1068  ·  view source on GitHub ↗

enableMaintNotificationsUpgrades initializes the maintnotifications upgrade manager and pool hook. This function is called during client initialization. will register push notification handlers for all maintenance upgrade events. will start background workers for handoff processing in the pool hook.

()

Source from the content-addressed store, hash-verified

1049// will register push notification handlers for all maintenance upgrade events.
1050// will start background workers for handoff processing in the pool hook.
1051func (c *baseClient) enableMaintNotificationsUpgrades() error {
1052 // Create client adapter
1053 clientAdapterInstance := newClientAdapter(c)
1054
1055 // Create maintnotifications manager directly
1056 manager, err := maintnotifications.NewManager(clientAdapterInstance, c.connPool, c.opt.MaintNotificationsConfig)
1057 if err != nil {
1058 return err
1059 }
1060 // Set the manager reference and initialize pool hook
1061 c.maintNotificationsManagerLock.Lock()
1062 c.maintNotificationsManager = manager
1063 c.maintNotificationsManagerLock.Unlock()
1064
1065 // Initialize pool hook (safe to call without lock since manager is now set)
1066 manager.InitPoolHook(c.dialHook)
1067 return nil
1068}
1069
1070func (c *baseClient) disableMaintNotificationsUpgrades() error {
1071 c.maintNotificationsManagerLock.Lock()

Callers 1

NewClientFunction · 0.80

Calls 3

InitPoolHookMethod · 0.95
NewManagerFunction · 0.92
newClientAdapterFunction · 0.85

Tested by

no test coverage detected