You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run lucky dev and at any point press Ctrl+C to stop it, sometimes the output is unclean, still logging process exits after my next terminal prompt has shown. This seems to be due to lucky dev not waiting for the process manager to exit when it receives the SIGINT signal.
It's most evident when using Foreman, since it's a bit slower to react to Ctrl+C than Overmind. Without a way to select the process manager in use, I've been forcing use of foreman by disabling my binaries which have higher priority:
…le the signal and finish - rather than us immediately exiting and leaving it to log shutting down messages from the background
Resolvesluckyframework#570. I've just used the approach I suggested there.
I wasn't sure how/if to write a spec for this, so I haven't. Is that acceptable?
To test it manually, I ran this from my app directory before and after the change to verify the behaviour:
```bash
$ crystal run ~/Projects/lucky_cli/src/lucky.cr -- dev
```
…le the signal and finish - rather than us immediately exiting and leaving it to log shutting down messages from the background (#572)
* lucky dev: When Ctrl+C is pressed, wait for the child process to handle the signal and finish - rather than us immediately exiting and leaving it to log shutting down messages from the background
Resolves#570. I've just used the approach I suggested there.
I wasn't sure how/if to write a spec for this, so I haven't. Is that acceptable?
To test it manually, I ran this from my app directory before and after the change to verify the behaviour:
```bash
$ crystal run ~/Projects/lucky_cli/src/lucky.cr -- dev
```
* Update src/lucky_cli/process_runner.cr
* oops. formatted
Co-authored-by: Jeremy Woertink <jeremywoertink@gmail.com>
When I run
lucky dev
and at any point press Ctrl+C to stop it, sometimes the output is unclean, still logging process exits after my next terminal prompt has shown. This seems to be due tolucky dev
not waiting for the process manager to exit when it receives theSIGINT
signal.It's most evident when using Foreman, since it's a bit slower to react to Ctrl+C than Overmind. Without a way to select the process manager in use, I've been forcing use of
foreman
by disabling my binaries which have higher priority:Example:
It looks like a fix would involve catching the interrupt before running the process manager
which works:
I reckon this could be added here:
lucky_cli/src/lucky_cli/process_runner.cr
Lines 33 to 38 in 1312680
I'll start working on a PR.
The text was updated successfully, but these errors were encountered: