When running a command where the appName is available, a preparer triggers a RunFinalizer background task to pull the app's associated hosts issues, if any.
The why is to present users as soon as possible with host issues affecting their apps.
How:
By triggering an async task as RunFinalizer, that will be executed after the main context completes.
Also performed some refactoring to move queryStatuspageIncidents to the incidents module instead of in command.go, and also convert from Run to RunFinalizer so it's executed at the end of the command to avoid interleaving the warning message with the command output.
Change Summary
What and Why:
When running a command where the appName is available, a preparer triggers a RunFinalizer background task to pull the app's associated hosts issues, if any. The why is to present users as soon as possible with host issues affecting their apps.
How: By triggering an async task as RunFinalizer, that will be executed after the main context completes.
Also performed some refactoring to move
queryStatuspageIncidents
to the incidents module instead of in command.go, and also convert fromRun
toRunFinalizer
so it's executed at the end of the command to avoid interleaving the warning message with the command output.Depends on https://github.com/superfly/fly-go/pull/67 to pass the checks