Skip to content

Commit

Permalink
chore: use for await to kill ports
Browse files Browse the repository at this point in the history
  • Loading branch information
wellwelwel committed May 14, 2024
1 parent 541c552 commit 121ba6d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/modules/create-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ const backgroundProcess = (
? await findPID.windows(port)
: await findPID.unix(port);

PIDs.forEach(async (subPID) => {
if (subPID)
isWindows
? await killPID.windows(subPID)
: await killPID.unix(subPID);
});
for (const subPID of PIDs) {
if (!subPID) continue;

isWindows
? await killPID.windows(subPID)
: await killPID.unix(subPID);
}

resolve(undefined);
return;
Expand Down

0 comments on commit 121ba6d

Please sign in to comment.