Skip to content

Commit c5a2469

Browse files
authored
fix(build): consider port opened for faulty status codes (#84)
1 parent cb67ca6 commit c5a2469

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/bin/commands/build.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,15 @@ export const buildCommand: yargs.CommandModule<
270270
// eslint-disable-next-line no-constant-condition
271271
while (true) {
272272
const res = await fetch(portInfo.getPreviewUrl());
273-
if (res.status < 400) {
273+
if (res.status !== 502 && res.status !== 503) {
274274
spinner.succeed(`Port ${port} is open (status ${res.status})`);
275275
break;
276-
} else {
277-
spinner.fail(
278-
`Port ${port} is not open yet (status ${res.status}), retrying in 1 second...`
279-
);
280-
await new Promise((resolve) => setTimeout(resolve, 1000));
281276
}
277+
278+
spinner.fail(
279+
`Port ${port} is not open yet (status ${res.status}), retrying in 1 second...`
280+
);
281+
await new Promise((resolve) => setTimeout(resolve, 1000));
282282
}
283283

284284
tasksWithPorts = tasksWithPorts.filter((t) => t.id !== task.id);

0 commit comments

Comments
 (0)