fix(startup): Exiting if server can't stop

This commit is contained in:
Chris Troutner
2021-12-29 17:46:05 -08:00
parent d6c3635c6a
commit b41f819783
39 changed files with 574 additions and 10 deletions
+10
View File
@@ -104,8 +104,18 @@ class Server {
return app
} catch (err) {
console.error('Could not start server. Error: ', err)
console.log(
'Exiting after 5 seconds. Depending on process manager to restart.'
)
await sleep(5000)
process.exit(1)
}
}
}
function sleep (ms) {
return new Promise((resolve) => setTimeout(resolve, ms))
}
module.exports = Server