소스 검색

Websocket can be closed.

Mathieu Lecarme 3 년 전
부모
커밋
4bfb1385bc
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      pkg/acquisition/modules/loki/loki.go

+ 3 - 0
pkg/acquisition/modules/loki/loki.go

@@ -374,6 +374,9 @@ func (l *LokiSource) StreamingAcquisition(out chan types.Event, t *tomb.Tomb) er
 				}
 				err = decoder.Decode(&resp)
 				if err != nil {
+					if err == io.EOF { // the websocket is closed
+						break
+					}
 					return errors.Wrap(err, "OneShotAcquisition error while parsing JSON websocket")
 				}
 				l.logger.WithField("type", t).WithField("message", resp).Debug("Message receveid")