From 051f640100646b40ce1d65a1bf4af85c9bfca212 Mon Sep 17 00:00:00 2001 From: nityanandagohain Date: Tue, 19 Jul 2022 16:38:28 +0530 Subject: [PATCH] correct var names in live tail --- pkg/query-service/app/http_handler.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/query-service/app/http_handler.go b/pkg/query-service/app/http_handler.go index d5ef57164c..a2f55fec60 100644 --- a/pkg/query-service/app/http_handler.go +++ b/pkg/query-service/app/http_handler.go @@ -1943,13 +1943,12 @@ func (aH *APIHandler) tailLogs(w http.ResponseWriter, r *http.Request) { return } - loop := true - for loop { + for { select { - case ev := <-client.Logs: + case log := <-client.Logs: var buf bytes.Buffer enc := json.NewEncoder(&buf) - enc.Encode(ev) + enc.Encode(log) fmt.Fprintf(w, "data: %v\n\n", buf.String()) flusher.Flush() case <-client.Done: