INNER CODE UNIT · JavaScript

installSignalHandlers

vestauth/vestauth · src/server/index.js:207

function installSignalHandlers () {
  if (SIGNAL_HANDLERS_INSTALLED) return

  const shutdown = () => {
    close()
      .then(() => process.exit(0))
      .catch((err) => {
        logger.error(err)
        process.exit(1)
      })
  }

  SIGNAL_HANDLERS = {
    SIGINT: () => shutdown('SIGINT'),
    SIGTERM: () => shutdown('SIGTERM')
  }

  process.once('SIGINT', SIGNAL_HANDLERS.SIGINT)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…