MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / terminateHostProcess

Function terminateHostProcess

desktop/runtime-host/client-bridge.ts:81–94  ·  view source on GitHub ↗
(child: ChildProcess | null | undefined)

Source from the content-addressed store, hash-verified

79let runtimeHostsShuttingDown = false
80
81function terminateHostProcess(child: ChildProcess | null | undefined) {
82 if (!child || child.killed || child.exitCode !== null) return
83
84 if (process.platform === 'win32' && child.pid) {
85 const taskkill = spawn('taskkill.exe', ['/pid', String(child.pid), '/t', '/f'], {
86 stdio: 'ignore',
87 windowsHide: true,
88 })
89 taskkill.unref()
90 return
91 }
92
93 child.kill('SIGTERM')
94}
95
96function killAllRuntimeHosts() {
97 for (const host of hosts) {

Callers 4

killAllRuntimeHostsFunction · 0.85
shutdownRuntimeHostsFunction · 0.85
ensureRuntimeHostFunction · 0.85

Calls 2

spawnFunction · 0.85
killMethod · 0.65

Tested by

no test coverage detected