MCPcopy
hub / github.com/garrytan/gstack / close

Function close

test/helpers/claude-pty-runner.ts:1368–1388  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1366 }
1367
1368 async function close(): Promise<void> {
1369 clearTimeout(wallTimer);
1370 clearTimeout(trustWatcherStop);
1371 clearInterval(trustWatcher);
1372 if (exited) return;
1373 try {
1374 proc.kill?.('SIGINT');
1375 } catch {
1376 /* ignore */
1377 }
1378 // Wait up to 2s for graceful exit.
1379 await Promise.race([exitedPromise, Bun.sleep(2000)]);
1380 if (!exited) {
1381 try {
1382 proc.kill?.('SIGKILL');
1383 } catch {
1384 /* ignore */
1385 }
1386 await Promise.race([exitedPromise, Bun.sleep(1000)]);
1387 }
1388 }
1389
1390 return {
1391 send,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected