MCPcopy Create free account
hub / github.com/tiann/hapi / cleanupAndExit

Function cleanupAndExit

cli/src/agent/runnerLifecycle.ts:74–86  ·  view source on GitHub ↗
(codeOverride?: number)

Source from the content-addressed store, hash-verified

72 }
73
74 const cleanupAndExit = async (codeOverride?: number) => {
75 if (codeOverride !== undefined) {
76 exitCode = codeOverride
77 }
78
79 try {
80 await cleanup()
81 process.exit(exitCode)
82 } catch (error) {
83 logger.debug(`${logPrefix} Error during cleanup:`, error)
84 process.exit(1)
85 }
86 }
87
88 const setExitCode = (code: number) => {
89 exitCode = code

Callers 1

registerProcessHandlersFunction · 0.85

Calls 2

debugMethod · 0.80
cleanupFunction · 0.70

Tested by

no test coverage detected