Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait for command to _completely_ finish before exiting. #143

Closed
Stebalien opened this issue Feb 19, 2019 · 0 comments
Closed

Wait for command to _completely_ finish before exiting. #143

Stebalien opened this issue Feb 19, 2019 · 0 comments

Comments

@Stebalien
Copy link
Member

We can't just wait for the exitCh (from cli.NewResponseEmitter) to finish. We need to wait for Run and PostRun to finish. Otherwise, we don't properly close the datastore.

Stebalien added a commit that referenced this issue Feb 19, 2019
It wasn't a reliable way to determine if the command was "done". We need to wait
for run, post-run, etc. to finish first.

* Fixes #143

This commit:

1. Removes the exit channel from the CLI response emitter.
2. Adds a `Status()` function to the `cli.ResponseEmitter` as a replacement
   for (1).
3. Renames `Exit(code)` to `SetStatus(code)`. This new function doesn't
   immediately _do_ anything other than set the status.
4. Make sure to wait for _everything_ to finish before returning from `cli.Run`.
Stebalien added a commit that referenced this issue Feb 19, 2019
It wasn't a reliable way to determine if the command was "done". We need to wait
for run, post-run, etc. to finish first.

* Fixes #143

This commit:

1. Removes the exit channel from the CLI response emitter.
2. Adds a `Status()` function to the `cli.ResponseEmitter` as a replacement
   for (1).
3. Renames `Exit(code)` to `SetStatus(code)`. This new function doesn't
   immediately _do_ anything other than set the status.
4. Make sure to wait for _everything_ to finish before returning from `cli.Run`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant