MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / cleanup

Function cleanup

apps/desktop/scripts/smoke-sidecar.ts:376–389  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

374 });
375
376 const cleanup = async () => {
377 if (exitCode === null) {
378 proc.kill("SIGTERM");
379 await Promise.race([proc.exited, Bun.sleep(3000)]);
380 if (exitCode === null) proc.kill("SIGKILL");
381 }
382 openapi.server.stop(true);
383 // oxlint-disable-next-line executor/no-promise-catch -- boundary: best-effort tempdir cleanup in a standalone smoke harness
384 await rm(scopeDir, { recursive: true, force: true }).catch(() => {});
385 // oxlint-disable-next-line executor/no-promise-catch -- boundary: best-effort tempdir cleanup in a standalone smoke harness
386 await rm(dataDir, { recursive: true, force: true }).catch(() => {});
387 // oxlint-disable-next-line executor/no-promise-catch -- boundary: best-effort tempdir cleanup in a standalone smoke harness
388 await rm(xdgDir, { recursive: true, force: true }).catch(() => {});
389 };
390
391 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: standalone smoke harness needs a finally to tear down the spawned binary + http server
392 try {

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected