MCPcopy Create free account
hub / github.com/pingdotgg/t3code / killOpenCodeProcessGroup

Function killOpenCodeProcessGroup

apps/server/src/provider/opencodeRuntime.ts:369–380  ·  view source on GitHub ↗
(signal: NodeJS.Signals)

Source from the content-addressed store, hash-verified

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")),

Callers 1

Calls 1

killMethod · 0.65

Tested by

no test coverage detected