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

Function stop

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

Source from the content-addressed store, hash-verified

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

Callers 2

stopOnParentSignalFunction · 0.70
startViteChildFunction · 0.70

Calls 2

disposeOwnedResourcesFunction · 0.85
killMethod · 0.80

Tested by

no test coverage detected