We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b80f150 + f3e7006 commit 3401a9bCopy full SHA for 3401a9b
packages/wmr/src/lib/net-utils.js
@@ -30,14 +30,13 @@ export async function isPortFree(port) {
30
* @returns {Promise<number>} The next free port
31
*/
32
export async function getFreePort(port) {
33
- let found = false;
34
let attempts = 0;
35
36
if (typeof port === 'string') port = parseInt(port, 10);
37
38
// Limit to 20 attempts for now
39
- while (!found && attempts <= 20) {
40
- if (isPortFree(port)) break;
+ while (attempts <= 20) {
+ if (await isPortFree(port)) break;
41
42
port++;
43
attempts++;
0 commit comments