diff --git a/client/server/server.go b/client/server/server.go index 397fb37e4..3a3193da7 100644 --- a/client/server/server.go +++ b/client/server/server.go @@ -218,7 +218,7 @@ func (s *Server) Start() error { // connectWithRetryRuns runs the client connection with a backoff strategy where we retry the operation as additional // mechanism to keep the client connected even when the connection is lost. -// we cancel retry if the client receive a stop or down command, or if disable auto connect is configured. +// we cancel retry if the client receive a stop or down command. func (s *Server) connectWithRetryRuns(ctx context.Context, profileConfig *profilemanager.Config, statusRecorder *peer.Status, runningChan chan struct{}, giveUpChan chan struct{}) { defer func() { s.mutex.Lock() @@ -226,14 +226,6 @@ func (s *Server) connectWithRetryRuns(ctx context.Context, profileConfig *profil s.mutex.Unlock() }() - if s.config.DisableAutoConnect { - if err := s.connect(ctx, s.config, s.statusRecorder, runningChan); err != nil { - log.Debugf("run client connection exited with error: %v", err) - } - log.Tracef("client connection exited") - return - } - backOff := getConnectWithBackoff(ctx) go func() { t := time.NewTicker(24 * time.Hour) @@ -1663,6 +1655,7 @@ func (s *Server) connect(ctx context.Context, config *profilemanager.Config, sta s.mutex.Unlock() if err := client.Run(runningChan, s.logFile); err != nil { + log.Debugf("run client connection exited with error: %v", err) return err } return nil