-
Notifications
You must be signed in to change notification settings - Fork 116
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
Conversation
@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. |
src/core/utils/net.ts
Outdated
//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); |
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.
logger.error(`Time "${time} is not a number.`, true); | |
logger.error(`--devserser-timeout should be a number expressed in milliseconds. Got "${time}".`, true); |
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.
Updated the same
src/core/utils/net.ts
Outdated
@@ -157,3 +157,12 @@ export function hostnameToIpAdress(hostnameOrIpAddress: string | undefined) { | |||
} | |||
return hostnameOrIpAddress; | |||
} | |||
|
|||
export function parseTime(time: string) { |
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.
export function parseTime(time: string) { | |
export function parseDevServerTimeout(time: string) { |
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.
Updated the same
src/core/utils/net.ts
Outdated
@@ -157,3 +157,12 @@ export function hostnameToIpAdress(hostnameOrIpAddress: string | undefined) { | |||
} | |||
return hostnameOrIpAddress; | |||
} | |||
|
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.
This function should be moved to src/core/utils/cli.ts
and must be tested.
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.
Updated and added tests
I left a few comments but overall looks great! |
@manekinekko I've made changes but made a mistake of pushing 2 commits to this PR. |
LGTM |
Resolves #253
Allows user to configure wait timeout before dev server starts using the flag
--devserver-timeout
, such as:swa start --devserver-timeout 10000