INNER CODE UNIT · JavaScript

cleanup

godaddy/terminus · lib/terminus.js:137

  async function cleanup (signal) {
    if (!state.isShuttingDown) {
      state.isShuttingDown = true
      try {
        await beforeShutdown()
        await asyncServerStop()
        await onSignal()
        await onShutdown()
        if (useExit0) {
          // Exit process
          process.exit(0)
        } else {
          // Resend recieved signal but remove traps beforehand
          signals.forEach(sig => process.removeListener(sig, cleanup))
          process.kill(process.pid, signal)
        }
      } catch (error) {
        logger('error happened during shutdown', error)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…