MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / installShutdownHooks

Function installShutdownHooks

bin/mcp-server.js:151–164  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

149
150let shutdownStarted = false
151function installShutdownHooks() {
152 const onSignal = (signal) => {
153 if (shutdownStarted) return
154 shutdownStarted = true
155 teardownContainer().finally(() => process.exit(signal === 'SIGINT' ? 130 : 0))
156 }
157 process.on('SIGTERM', () => onSignal('SIGTERM'))
158 process.on('SIGINT', () => onSignal('SIGINT'))
159 process.on('beforeExit', () => {
160 if (shutdownStarted) return
161 shutdownStarted = true
162 teardownContainer().catch(() => {})
163 })
164}
165
166let runLock = Promise.resolve()
167async function withLock(fn) {

Callers 1

mainFunction · 0.85

Calls 2

onSignalFunction · 0.85
teardownContainerFunction · 0.85

Tested by

no test coverage detected