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

Function stop

apps/local/src/serve.ts:164–175  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

162
163 let stopping = false;
164 const stop = async (): Promise<void> => {
165 if (stopping) {
166 await child.exited;
167 return;
168 }
169 stopping = true;
170 for (const signal of viteChildSignals) process.off(signal, stopOnParentSignal);
171 if (child.exitCode === null) child.kill();
172 await Promise.race([child.exited, Bun.sleep(5_000)]);
173 if (child.exitCode === null) child.kill("SIGKILL");
174 await child.exited;
175 };
176 const stopOnParentSignal = (): void => {
177 // A PTY/session teardown can signal the CLI while Vite is still optimizing
178 // dependencies, before the server's normal stop handle exists. Reap the

Callers 2

stopOnParentSignalFunction · 0.70
startViteChildFunction · 0.70

Calls 1

disposeOwnedResourcesFunction · 0.85

Tested by

no test coverage detected