(proc: DaemonProc)
| 106 | : new Promise((resolve) => proc.once("exit", () => resolve())); |
| 107 | |
| 108 | const stopProc = async (proc: DaemonProc): Promise<void> => { |
| 109 | if (proc.exitCode !== null || proc.signalCode !== null) return; |
| 110 | if (proc.pid) process.kill(-proc.pid, "SIGTERM"); |
| 111 | await Promise.race([exited(proc), new Promise<void>((resolve) => setTimeout(resolve, 3000))]); |
| 112 | if (proc.exitCode === null && proc.signalCode === null && proc.pid) { |
| 113 | process.kill(-proc.pid, "SIGKILL"); |
| 114 | await exited(proc); |
| 115 | } |
| 116 | }; |
| 117 | |
| 118 | const startForegroundDaemon = (dataDir: string) => |
| 119 | Effect.acquireRelease( |
no test coverage detected