File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -359,7 +359,7 @@ func (cr *Cluster) Enable(ctx context.Context) (err error) {
359
359
if ! ok {
360
360
if keepaliveCtx .Err () == nil {
361
361
logInfo ("Reconnecting due to keepalive failed" )
362
- cr .Disable (ctx )
362
+ cr .disable (ctx )
363
363
logInfo ("Reconnecting ..." )
364
364
if ! cr .Connect (ctx ) {
365
365
logError ("Cannot reconnect to server, exit." )
@@ -422,11 +422,14 @@ func (cr *Cluster) disconnected() bool {
422
422
}
423
423
424
424
func (cr * Cluster ) Disable (ctx context.Context ) (ok bool ) {
425
+ cr .shouldEnable .Store (false )
426
+ return cr .disable (ctx )
427
+ }
428
+
429
+ func (cr * Cluster ) disable (ctx context.Context ) (ok bool ) {
425
430
cr .mux .Lock ()
426
431
defer cr .mux .Unlock ()
427
432
428
- cr .shouldEnable .Store (false )
429
-
430
433
if ! cr .enabled .Load () {
431
434
logDebug ("Extra disable" )
432
435
return false
You can’t perform that action at this time.
0 commit comments