fix ctrl+c during setup

This commit is contained in:
lesion 2022-06-22 11:31:14 +02:00
parent 05d068f022
commit 7516fd3d36
No known key found for this signature in database
GPG key ID: 352918250B012177

View file

@ -3,12 +3,14 @@ const config = require('../server/config')
const initialize = {
// close connections/port/unix socket
async shutdown (exit = true) {
if (config.status == 'READY') {
const log = require('../server/log')
const TaskManager = require('../server/taskManager').TaskManager
if (TaskManager) { TaskManager.stop() }
log.info('Closing DB')
const sequelize = require('../server/api/models')
await sequelize.close()
}
process.off('SIGTERM', initialize.shutdown)
process.off('SIGINT', initialize.shutdown)
if (exit) {