소스 검색

[client] Fixed a bug where service loops reconnection after disconnection.service is shut down and can not exit goroutine (#3012)

Co-authored-by: lizhisheng <zhishengli@deepglint.com>
ChristLZS 2 년 전
부모
커밋
6f2571980c
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      client/service.go

+ 4 - 0
client/service.go

@@ -198,6 +198,10 @@ func (svr *Service) keepControllerWorking() {
 		}
 
 		for {
+			if atomic.LoadUint32(&svr.exit) != 0 {
+				return
+			}
+
 			xl.Info("try to reconnect to server...")
 			conn, session, err := svr.login()
 			if err != nil {