MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / cleanup

Function cleanup

projects/electron/src/modules/code/pty.ts:353–374  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

351}
352
353export const cleanup = () => {
354 logger.info("[Pty] Cleanup called, killing all active PTYs")
355
356 for (const [ptyId, p] of activePtys) {
357 if (p.cleanupTimeoutId) {
358 clearTimeout(p.cleanupTimeoutId)
359 }
360
361 if (!p.exited) {
362 try {
363 p.pty.kill()
364 } catch {
365 // Ignore errors during cleanup
366 }
367 emitLifecycle({ type: "killed", ptyId })
368 }
369
370 activePtys.delete(ptyId)
371 }
372
373 logger.info("[Pty] Cleanup complete")
374}

Callers 1

killAllRuntimePtysFunction · 0.70

Calls 3

emitLifecycleFunction · 0.70
killMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected