添加 - 加入退出事件

This commit is contained in:
suwings 2018-04-18 20:08:09 +08:00
parent 16e7edb826
commit 400166a46e

15
app.js
View File

@ -13,7 +13,7 @@ try {
global.MCSERVER = {};
//全局仅限本地配置
MCSERVER.localProperty = {}
MCSERVER.localProperty = {};
//加载配置
require('./property');
@ -258,4 +258,15 @@ app.use('/fs', require('./onlinefs/controller/function'));
require('./ftpd/index');
});
})();
})();
//退出事件
let _endFlag = false;
process.on('SIGINT', function () {
if (_endFlag) return;
_endFlag = true;
MCSERVER.infoLog('EXIT', '程序正在结束,请稍等...');
setTimeout(() => {
process.exit(0);
}, 5000)
});