force exiting the etui upon worker error (#583)

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
Alex Goodman 2021-10-22 13:44:50 -04:00 committed by GitHub
parent 7b319e32bb
commit d5b425e1b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -250,7 +250,7 @@ cli: $(SNAPSHOTDIR) ## Run CLI tests
SYFT_BINARY_LOCATION='$(SNAPSHOT_CMD)' \ SYFT_BINARY_LOCATION='$(SNAPSHOT_CMD)' \
go test -count=1 -v ./test/cli go test -count=1 -v ./test/cli
.PHONY: changlog-release .PHONY: changelog-release
changelog-release: changelog-release:
$(TEMPDIR)/chronicle --since-tag $(SECOND_TO_LAST_TAG) --until-tag $(LAST_TAG) -vv > CHANGELOG.md $(TEMPDIR)/chronicle --since-tag $(SECOND_TO_LAST_TAG) --until-tag $(LAST_TAG) -vv > CHANGELOG.md

View File

@ -44,6 +44,9 @@ func eventLoop(workerErrs <-chan error, signals <-chan os.Signal, subscription *
if err := subscription.Unsubscribe(); err != nil { if err := subscription.Unsubscribe(); err != nil {
retErr = multierror.Append(retErr, err) retErr = multierror.Append(retErr, err)
} }
// 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
} }
case e, isOpen := <-events: case e, isOpen := <-events:
if !isOpen { if !isOpen {
@ -53,7 +56,6 @@ func eventLoop(workerErrs <-chan error, signals <-chan os.Signal, subscription *
if err := ux.Handle(e); err != nil { if err := ux.Handle(e); err != nil {
if errors.Is(err, partybus.ErrUnsubscribe) { if errors.Is(err, partybus.ErrUnsubscribe) {
log.Warnf("unable to unsubscribe from the event bus")
events = nil events = nil
} else { } else {
retErr = multierror.Append(retErr, err) retErr = multierror.Append(retErr, err)