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
added feature to automatically change port #2867
added feature to automatically change port #2867
Conversation
I've implemented something similar, but added just auto select functionality after 5 sec instead of by default. You can find the changes here https://github.com/srikary12/reflex-dev |
I do like you idea of informing the user before auto selecting the ports but I believe it would be better to have a property in the config something like "auto_select_port: Bool". Since asking the user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
new_port = str(int(port) + 1) | ||
if is_process_on_port(new_port): | ||
return change_port(new_port) | ||
return new_port |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we should print an info message here, similar to the one that was removed
console.info(
f"The {_type} will run on port [bold underline]{new_port}[/bold underline]."
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure will do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@masenf Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great for me, this is a sweet improvement!
All Submissions:
Type of change
Please delete options that are not relevant.
New Feature Submission:
Changes To Core Features:
Description
Added feature to automatically change port if currently one is used.
Linked Issue
Closes #2857