[cli] Fix vc dev when user has ipv6 configured (#7956)

Running tests from #7455 

- Fixes #7306
- Closes #7455
This commit is contained in:
Steven
2022-06-13 17:04:00 -04:00
committed by GitHub
parent 0d302a6f48
commit 0e8278f490
4 changed files with 8 additions and 20 deletions

View File

@@ -2447,12 +2447,10 @@ function needsBlockingBuild(buildMatch: BuildMatch): boolean {
return typeof builder.shouldServe !== 'function';
}
async function checkForPort(
port: number | undefined,
timeout: number
): Promise<void> {
async function checkForPort(port: number, timeout: number): Promise<void> {
const opts = { host: '127.0.0.1' };
const start = Date.now();
while (!(await isPortReachable(port))) {
while (!(await isPortReachable(port, opts))) {
if (Date.now() - start > timeout) {
throw new Error(`Detecting port ${port} timed out after ${timeout}ms`);
}