From 3cc08494a56b30bab8663935eb158906a68bed20 Mon Sep 17 00:00:00 2001 From: adamdottv <2363879+adamdottv@users.noreply.github.com> Date: Mon, 5 May 2025 14:23:29 -0500 Subject: fix: pubsub leak and shutdown seq --- cmd/root.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'cmd/root.go') diff --git a/cmd/root.go b/cmd/root.go index f288c9f69..f2c42833a 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -123,12 +123,12 @@ to assist developers in writing, debugging, and understanding code directly from // Cleanup function for when the program exits cleanup := func() { - // Shutdown the app - app.Shutdown() - // Cancel subscriptions first cancelSubs() + // Then shutdown the app + app.Shutdown() + // Then cancel TUI message handler tuiCancel() @@ -188,6 +188,10 @@ func setupSubscriber[T any]( defer logging.RecoverPanic(fmt.Sprintf("subscription-%s", name), nil) subCh := subscriber(ctx) + if subCh == nil { + logging.Warn("subscription channel is nil", "name", name) + return + } for { select { -- cgit v1.2.3