From ba61f9dd4ed0cec977e3f8c9c66d3eebf40d3049 Mon Sep 17 00:00:00 2001 From: iBug Date: Fri, 6 Sep 2024 00:14:12 +0800 Subject: [PATCH] Restore old timing of systemd.NotifyReady() --- cmd/run.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/run.go b/cmd/run.go index fc2a88f..4d0d04c 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -65,10 +65,10 @@ func runWithConfig(cmd *cobra.Command, args []string, config analyze.AnalyzerCon return err } else { // Tail mode - var errCh chan error - go func() { - errCh <- analyzer.TailFile(filenames[0]) - }() + iter, err := analyzer.OpenTailIterator(filenames[0]) + if err != nil { + return err + } if config.Daemon { if err := systemd.NotifyReady(); err != nil { @@ -78,7 +78,7 @@ func runWithConfig(cmd *cobra.Command, args []string, config analyze.AnalyzerCon go tui.New(analyzer).Run() } - return <-errCh + return analyzer.RunLoop(iter) } }