From 88f4bcfca8e1d749a2e1b9cdc0556c54fc442265 Mon Sep 17 00:00:00 2001 From: Jordan Webb Date: Thu, 15 Jul 2021 14:16:31 -0500 Subject: [PATCH] Honor `login_fail_exit` when reconnecting `login_fail_exit` is honored when initially connecting, but currently has no effect when reconnecting. This adds a check after attempting to reconnect, so that a failure there is treated the same as a failure during the initial connection, if `login_fail_exit` is set to true. --- client/service.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/service.go b/client/service.go index 3033ee2a..35a6c184 100644 --- a/client/service.go +++ b/client/service.go @@ -177,6 +177,9 @@ func (svr *Service) keepControllerWorking() { xl.Info("try to reconnect to server...") conn, session, err := svr.login() if err != nil { + if svr.cfg.LoginFailExit { + return err + } xl.Warn("reconnect to server error: %v", err) time.Sleep(delayTime)