Skip to content

Commit

Permalink
fix: Improving exec cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
AlfieJones committed Jun 18, 2024
1 parent 06a9e9b commit 6343b8a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/tasty-dots-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"pixeleye": patch
---

Improving exec cleanup
7 changes: 5 additions & 2 deletions integrations/cli/pixeleye/src/handlers/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ export async function execHandler(
});

onExitFns.push(async () => {
child.kill();
child.stdin?.end();
child.stdout?.destroy();
child.stderr?.destroy();
child.kill("SIGKILL");
});

fileSpinner.succeed("Successfully started local snapshot server.");
Expand Down Expand Up @@ -166,7 +169,7 @@ export async function execHandler(
console.log(`\nBuild status: ${finalStatus}`);
}

child.kill();
await Promise.all(onExitFns.map((fn) => fn()));

process.exit(0);
}

0 comments on commit 6343b8a

Please sign in to comment.