Skip to content

Commit

Permalink
Log on port increment
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicole White committed Feb 20, 2024
1 parent 2cfa6bb commit 6c473a1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/handlers/testing/exec/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ async function findAvailablePort(args: { startPort: number }): Promise<number> {

server.on('error', (err) => {
if ((err as { code?: string } | undefined)?.code === 'EADDRINUSE') {
tryListening(port + 1);
const nextPort = port + 1;
emitter.emit(EventName.CONSOLE_LOG, {
ctx: 'cli-server',
level: 'info',
message: `Port ${port} is in use, trying port ${nextPort}...`,
});
tryListening(nextPort);
} else {
reject(err);
}
Expand Down

0 comments on commit 6c473a1

Please sign in to comment.