feat: add flag to disable shell mode for nest start --watch
#2522
+14
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When running on Linux/WSL,
nest start --watch
does not wait the app to shutdown on restart. That leads to two instances of application running simultaneously, especially if it has async shutdown hooks. That commit fixes that adding an option to disable shell mode when spawning child processes so then app will completely shutdown first and only then started again. Thanks @jleverenz for the investigation and solution idea in #1641fixes nestjs/nest-cli/1614
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Nest does not wait for app to stop when doing hot reload (on files change)
Issue Number: #1614
What is the new behavior?
Now running
nest start --watch --noShell
hot reload will first wait for app to gracefully stopDoes this PR introduce a breaking change?
Other information