(pid: number, timeoutMs: number)
| 26 | }; |
| 27 | |
| 28 | const waitUntilStopped = async (pid: number, timeoutMs: number): Promise<boolean> => { |
| 29 | const deadline = performance.now() + timeoutMs; |
| 30 | while (performance.now() < deadline) { |
| 31 | if (!isAlive(pid)) return true; |
| 32 | await new Promise((resolve) => setTimeout(resolve, 50)); |
| 33 | } |
| 34 | return !isAlive(pid); |
| 35 | }; |
| 36 | |
| 37 | /** Stop the detached daemon elected by an `executor mcp` cold start. */ |
| 38 | export const stopAutoSpawnedDaemon = async (dataDir: string): Promise<void> => { |
no test coverage detected