From 3690b89082215ff5c1fc84110074cf08b1b8909c Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 1 Mar 2026 23:33:46 +0200 Subject: Route non-fatal event-loop warnings to TUI --- internal/flamegraph/iordatacollector.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'internal/flamegraph') diff --git a/internal/flamegraph/iordatacollector.go b/internal/flamegraph/iordatacollector.go index a63b742..948af97 100644 --- a/internal/flamegraph/iordatacollector.go +++ b/internal/flamegraph/iordatacollector.go @@ -5,7 +5,6 @@ import ( "fmt" "ior/internal/event" "ior/internal/flags" - "os" "runtime" "sync" ) @@ -13,14 +12,14 @@ import ( type IorDataCollector struct { flags flags.Flags Ch chan *event.Pair - Done chan struct{} + Done chan error workers []worker } func New() IorDataCollector { f := IorDataCollector{ Ch: make(chan *event.Pair, 4096), - Done: make(chan struct{}), + Done: make(chan error, 1), } numWorkers := runtime.NumCPU() / 4 if numWorkers == 0 { @@ -52,8 +51,9 @@ func (f IorDataCollector) Start(ctx context.Context) { } } if err := iod.serializeToFile(); err != nil { - fmt.Println(err) - os.Exit(2) + f.Done <- err + return } + f.Done <- nil }() } -- cgit v1.2.3