fix quit on ctrl+c

This commit is contained in:
lesion
2019-07-08 00:49:03 +02:00
parent 8410e8beee
commit 341dc594e0

View File

@@ -37,7 +37,10 @@ async function start() {
// close connections/port/unix socket
function shutdown() {
consola.info(`Closing connections..`)
server.close()
server.close(() => {
// TODO, close db connection?
process.exit()
})
}
process.on('SIGTERM', shutdown)
process.on('SIGINT', shutdown)