MCPcopy Index your code
hub / github.com/anomalyco/opencode / abort

Function abort

packages/opencode/src/util/process.ts:74–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

72 let timer: ReturnType<typeof setTimeout> | undefined
73
74 const abort = () => {
75 if (closed) return
76 if (proc.exitCode !== null || proc.signalCode !== null) return
77 closed = true
78
79 proc.kill(opts.kill ?? "SIGTERM")
80
81 const ms = opts.timeout ?? 5_000
82 if (ms <= 0) return
83 timer = setTimeout(() => proc.kill("SIGKILL"), ms)
84 }
85
86 const exited = new Promise<number>((resolve, reject) => {
87 const done = () => {

Callers 1

spawnFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected