Skip to content

Commit 06ea120

Browse files
committed
wip
1 parent ca73e4b commit 06ea120

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

redis.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error {
432432

433433
// Enable maintenance notifications if hitless upgrades are configured
434434
c.optLock.RLock()
435-
hitlessEnabled := c.opt.HitlessUpgradeConfig.IsEnabled()
435+
hitlessEnabled := c.opt.HitlessUpgradeConfig != nil && c.opt.HitlessUpgradeConfig.Enabled != hitless.MaintNotificationsDisabled
436436
protocol := c.opt.Protocol
437437
endpointType := c.opt.HitlessUpgradeConfig.EndpointType
438438
c.optLock.RUnlock()
@@ -923,7 +923,7 @@ func NewClient(opt *Options) *Client {
923923
c.pubSubPool = newPubSubPool(opt, c.dialHook)
924924

925925
// Initialize hitless upgrades first if enabled and protocol is RESP3
926-
if opt.HitlessUpgradeConfig.IsEnabled() && opt.Protocol == 3 {
926+
if opt.HitlessUpgradeConfig != nil && opt.HitlessUpgradeConfig.Enabled != hitless.MaintNotificationsDisabled && opt.Protocol == 3 {
927927
err := c.enableHitlessUpgrades()
928928
if err != nil {
929929
internal.Logger.Printf(context.Background(), "hitless: failed to initialize hitless upgrades: %v", err)

0 commit comments

Comments
 (0)