INNER CODE UNIT · TypeScript

handleTerminationSignals

linode/apl-core · src/operator/main.ts:42

function handleTerminationSignals(operator: AplOperator): void {
  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 })
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…