From 9b5e55aecddce55b63f1e4a79009e90fadf36b23 Mon Sep 17 00:00:00 2001 From: Andrei Stan Date: Wed, 10 Apr 2024 18:21:47 +0300 Subject: [PATCH] fix(logtail): Output multiline text on single inotify event Signed-off-by: Andrei Stan --- internal/logtail/logtail.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/logtail/logtail.go b/internal/logtail/logtail.go index f19999115c..3443bf67bd 100644 --- a/internal/logtail/logtail.go +++ b/internal/logtail/logtail.go @@ -64,7 +64,11 @@ func NewLogTail(ctx context.Context, logFile string) (chan string, chan error, e switch event.Op { case fsnotify.Write: - peekAndRead(f, reader, &logs, &errs) + for { + if peekAndRead(f, reader, &logs, &errs) { + break + } + } } } }