From e3b34813d769db1bb62889a68bdbdd190f74d2af Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Mon, 22 Nov 2021 16:07:55 -0500 Subject: [PATCH] ignore partybus unsubscribe errors (#641) Signed-off-by: Alex Goodman --- cmd/event_loop.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/event_loop.go b/cmd/event_loop.go index 53a2dd90f..6af43d2d9 100644 --- a/cmd/event_loop.go +++ b/cmd/event_loop.go @@ -14,7 +14,7 @@ import ( // eventLoop listens to worker errors (from execution path), worker events (from a partybus subscription), and // signal interrupts. Is responsible for handling each event relative to a given UI an to coordinate eventing until // an eventual graceful exit. -// nolint:gocognit,funlen +// nolint:funlen func eventLoop(workerErrs <-chan error, signals <-chan os.Signal, subscription *partybus.Subscription, cleanupFn func(), uxs ...ui.UI) error { defer cleanupFn() events := subscription.Events() @@ -41,9 +41,7 @@ func eventLoop(workerErrs <-chan error, signals <-chan os.Signal, subscription * if err != nil { // capture the error from the worker and unsubscribe to complete a graceful shutdown retErr = multierror.Append(retErr, err) - if err := subscription.Unsubscribe(); err != nil { - retErr = multierror.Append(retErr, err) - } + _ = subscription.Unsubscribe() // the worker has exited, we may have been mid-handling events for the UI which should now be // ignored, in which case forcing a teardown of the UI irregardless of the state is required. forceTeardown = true