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.
()
| 1049 | // will register push notification handlers for all maintenance upgrade events. |
| 1050 | // will start background workers for handoff processing in the pool hook. |
| 1051 | func (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 | |
| 1070 | func (c *baseClient) disableMaintNotificationsUpgrades() error { |
| 1071 | c.maintNotificationsManagerLock.Lock() |
no test coverage detected