Call os.Exit on reconnect login fail

This commit is contained in:
Jordan Webb 2021-07-15 14:30:25 -05:00
parent 88f4bcfca8
commit 574322c96d
No known key found for this signature in database
GPG Key ID: C341950C47B6CE14

View File

@ -21,6 +21,7 @@ import (
"fmt"
"io/ioutil"
"net"
"os"
"runtime"
"strconv"
"sync"
@ -178,7 +179,8 @@ func (svr *Service) keepControllerWorking() {
conn, session, err := svr.login()
if err != nil {
if svr.cfg.LoginFailExit {
return err
xl.Error("reconnect to server error, exiting: %v", err)
os.Exit(1)
}
xl.Warn("reconnect to server error: %v", err)
time.Sleep(delayTime)