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

Feature Request: Reuse random port number when using run command #31

Open
svicalifornia opened this issue Jun 24, 2022 · 1 comment · May be fixed by #34
Open

Feature Request: Reuse random port number when using run command #31

svicalifornia opened this issue Jun 24, 2022 · 1 comment · May be fixed by #34

Comments

@svicalifornia
Copy link

The chalet CLI has a run command, which sets up and runs a temporary server, outputs the server's logs to STDOUT, and removes the server config (to clean up) when the server process has stopped.

However, if I need to stop the server and restart it for some reason, then it will run under a different port number the second time (typically the next number in some sequence). If I switch to the browser tab where I had loaded the app in its first run, it will have the first port number in its URL, but that port number is no longer being used — therefore reloading that tab will fail with a server-not-found error.

It would be great if the chalet daemon would remember servers previously run and their assigned port numbers, so that if another server is run with the same name, the previously used port number could be reused. This could simply be an in-memory hash that would persist only while the chalet daemon is running. The run command would still clear the server's temporary config file when the run command exits, but just keep the port number in an entry for that server name in the daemon's memory.

@svicalifornia
Copy link
Author

svicalifornia commented Jun 24, 2022

And no, using the -p/--port option is not a suitable workaround for this request. I specifically want chalet to assign the port numbers and ensure that each server will have a unique port number. However, I also want chalet to reuse a port number when a server is killed and restarted.

svicalifornia added a commit to appjudo/chalet that referenced this issue Jun 24, 2022
svicalifornia added a commit to appjudo/chalet that referenced this issue Jun 24, 2022
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 a pull request may close this issue.

1 participant