INNER CODE UNIT · TypeScript
exitHandler
linode/apl-core · src/operator/main.ts:43
function exitHandler(signal: string) {
d.info(`Received ${signal}, shutting down...`)
operator.stop()
process.exit(0)
}
process.on('SIGTERM', () => exitHandler('SIGTERM'))
process.on('SIGINT', () => exitHandler('SIGINT'))
}
function ensureDirectoryStructure() {
const repoPath = env.ENV_DIR
const parentDir = path.dirname(repoPath)
if (!fs.existsSync(parentDir)) {
fs.mkdirSync(parentDir, { recursive: true })
}
if (!fs.existsSync(repoPath)) {