mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
fix ctrl+c during setup
This commit is contained in:
parent
05d068f022
commit
7516fd3d36
1 changed files with 8 additions and 6 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue