From f32e678f9cda4139e1128f9730a28a2044af1182 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 f19999115..3443bf67b 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 + } + } } } }