mirror of
https://framagit.org/les/gancio.git
synced 2025-02-01 00:52:01 +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 = {
|
const initialize = {
|
||||||
// close connections/port/unix socket
|
// close connections/port/unix socket
|
||||||
async shutdown (exit = true) {
|
async shutdown (exit = true) {
|
||||||
|
if (config.status == 'READY') {
|
||||||
const log = require('../server/log')
|
const log = require('../server/log')
|
||||||
const TaskManager = require('../server/taskManager').TaskManager
|
const TaskManager = require('../server/taskManager').TaskManager
|
||||||
if (TaskManager) { TaskManager.stop() }
|
if (TaskManager) { TaskManager.stop() }
|
||||||
log.info('Closing DB')
|
log.info('Closing DB')
|
||||||
const sequelize = require('../server/api/models')
|
const sequelize = require('../server/api/models')
|
||||||
await sequelize.close()
|
await sequelize.close()
|
||||||
|
}
|
||||||
process.off('SIGTERM', initialize.shutdown)
|
process.off('SIGTERM', initialize.shutdown)
|
||||||
process.off('SIGINT', initialize.shutdown)
|
process.off('SIGINT', initialize.shutdown)
|
||||||
if (exit) {
|
if (exit) {
|
||||||
|
|
Loading…
Reference in a new issue