fix quit on ctrl+c
This commit is contained in:
@@ -37,7 +37,10 @@ async function start() {
|
|||||||
// close connections/port/unix socket
|
// close connections/port/unix socket
|
||||||
function shutdown() {
|
function shutdown() {
|
||||||
consola.info(`Closing connections..`)
|
consola.info(`Closing connections..`)
|
||||||
server.close()
|
server.close(() => {
|
||||||
|
// TODO, close db connection?
|
||||||
|
process.exit()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
process.on('SIGTERM', shutdown)
|
process.on('SIGTERM', shutdown)
|
||||||
process.on('SIGINT', shutdown)
|
process.on('SIGINT', shutdown)
|
||||||
|
|||||||
Reference in New Issue
Block a user