From 4bfb1385bce7656e98de1f20a79eb41ac96b8cbb Mon Sep 17 00:00:00 2001 From: Mathieu Lecarme Date: Mon, 20 Jun 2022 17:14:30 +0200 Subject: [PATCH] Websocket can be closed. --- pkg/acquisition/modules/loki/loki.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/acquisition/modules/loki/loki.go b/pkg/acquisition/modules/loki/loki.go index d09cec2fa..c0eefccfd 100644 --- a/pkg/acquisition/modules/loki/loki.go +++ b/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")