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

feat: add flag to disable shell mode for nest start --watch #2522

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

quallrum
Copy link

@quallrum quallrum commented Feb 21, 2024

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 #1641

fixes 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?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

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 stop

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

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 nestjs/nest-cli/1614

fixes nestjs/nest-cli/1614
@jeengbe
Copy link

jeengbe commented May 7, 2024

Any update on this? 🙂 The EADDRINUSE issue makes local development rather inconvenient

@quallrum
Copy link
Author

quallrum commented May 9, 2024

@kamilmysliwiec is there smth we can do to get this PR merged?

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

Successfully merging this pull request may close these issues.

None yet

2 participants