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: Configure await timeout before connecting to a dev server #255

Merged
merged 2 commits into from
Jul 17, 2021

Conversation

sgollapudi77
Copy link
Contributor

Resolves #253
Allows user to configure wait timeout before dev server starts using the flag --devserver-timeout, such as:
swa start --devserver-timeout 10000

@github-actions github-actions bot added scope: cli Issues happened a the ./src/cli level scope: core Issues happened a the ./src/core level labels Jul 8, 2021
@sgollapudi77
Copy link
Contributor Author

Screenshot (27)

@sgollapudi77
Copy link
Contributor Author

@manekinekko can you please check the PR once and tell me if I need to add some checks (or) do I need to change some naming convention (or) anything at all.
Thanks

//The argument 10 implies to convert the given string to base-10(decimal)
const timeValue = parseInt(time, 10);
if (isNaN(timeValue)) {
logger.error(`Time "${time} is not a number.`, true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logger.error(`Time "${time} is not a number.`, true);
logger.error(`--devserser-timeout should be a number expressed in milliseconds. Got "${time}".`, true);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the same

@@ -157,3 +157,12 @@ export function hostnameToIpAdress(hostnameOrIpAddress: string | undefined) {
}
return hostnameOrIpAddress;
}

export function parseTime(time: string) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export function parseTime(time: string) {
export function parseDevServerTimeout(time: string) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the same

@@ -157,3 +157,12 @@ export function hostnameToIpAdress(hostnameOrIpAddress: string | undefined) {
}
return hostnameOrIpAddress;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function should be moved to src/core/utils/cli.ts and must be tested.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated and added tests

@manekinekko
Copy link
Member

I left a few comments but overall looks great!

@sgollapudi77
Copy link
Contributor Author

@manekinekko I've made changes but made a mistake of pushing 2 commits to this PR.

@manekinekko
Copy link
Member

LGTM

@manekinekko manekinekko added the pr: lgtm A PR has been reviewed (CI is green) and is ready to be merged label Jul 12, 2021
@sgollapudi77 sgollapudi77 merged commit e6cbf08 into main Jul 17, 2021
@sgollapudi77 sgollapudi77 deleted the issue-253 branch July 17, 2021 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: lgtm A PR has been reviewed (CI is green) and is ready to be merged scope: cli Issues happened a the ./src/cli level scope: core Issues happened a the ./src/core level
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow configuring the await timeout before connecting to a dev server
2 participants