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.
This commit is contained in:
Jordan Webb 2021-07-15 14:16:31 -05:00 committed by GitHub
parent 2a68c1152f
commit 88f4bcfca8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -177,6 +177,9 @@ func (svr *Service) keepControllerWorking() {
xl.Info("try to reconnect to server...") xl.Info("try to reconnect to server...")
conn, session, err := svr.login() conn, session, err := svr.login()
if err != nil { if err != nil {
if svr.cfg.LoginFailExit {
return err
}
xl.Warn("reconnect to server error: %v", err) xl.Warn("reconnect to server error: %v", err)
time.Sleep(delayTime) time.Sleep(delayTime)