(signal: NodeJS.Signals)
| 367 | ); |
| 368 | |
| 369 | const killOpenCodeProcessGroup = (signal: NodeJS.Signals) => |
| 370 | hostPlatform === "win32" |
| 371 | ? child.kill({ killSignal: signal, forceKillAfter: "1 second" }).pipe(Effect.asVoid) |
| 372 | : Effect.sync(() => { |
| 373 | try { |
| 374 | process.kill(-Number(child.pid), signal); |
| 375 | } catch { |
| 376 | // The direct child may already have exited after starting the |
| 377 | // server; the process group kill is best-effort cleanup for |
| 378 | // any serve process left in that group. |
| 379 | } |
| 380 | }); |
| 381 | const terminateChild = killOpenCodeProcessGroup("SIGTERM").pipe( |
| 382 | Effect.andThen(Effect.sleep("1 second")), |
| 383 | Effect.andThen(killOpenCodeProcessGroup("SIGKILL")), |
no test coverage detected