mirror of
https://github.com/MCSManager/MCSManager.git
synced 2025-04-06 17:10:29 +08:00
添加 - 加入退出事件
This commit is contained in:
parent
16e7edb826
commit
400166a46e
15
app.js
15
app.js
@ -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)
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user