Exemplo n.º 1
0
  process.on('SIGINT', () => {
    console.log(`\n  ${chalk.red('Shutting down server.')}\n`)
    db.destroy()
    server.close((e) => process.exit(1))

    setTimeout(() => {
      console.log(`  ${chalk.red(`Could not close server in time (${timeout}ms), forcefully shutting down.`)}\n`)
      process.exit(1)
    }, timeout).unref()
  })
Exemplo n.º 2
0
 .then(() => db.destroy())