Call shutdown() of msg network modules @ shutdown
This commit is contained in:
parent
b17bd15c46
commit
97c2e7adc0
|
@ -100,10 +100,15 @@ function shutdownSystem() {
|
|||
},
|
||||
function stopEventScheduler(callback) {
|
||||
if(initServices.eventScheduler) {
|
||||
return initServices.eventScheduler.shutdown(callback);
|
||||
return initServices.eventScheduler.shutdown( () => {
|
||||
callback(null); // ignore err
|
||||
});
|
||||
} else {
|
||||
return callback(null);
|
||||
}
|
||||
},
|
||||
function stopMsgNetwork(callback) {
|
||||
require('./msg_network.js').shutdown(callback);
|
||||
}
|
||||
],
|
||||
() => {
|
||||
|
|
|
@ -7,7 +7,7 @@ let loadModulesForCategory = require('./module_util.js').loadModulesForCategory;
|
|||
// standard/deps
|
||||
let async = require('async');
|
||||
|
||||
exports.startup = startup
|
||||
exports.startup = startup;
|
||||
exports.shutdown = shutdown;
|
||||
exports.recordMessage = recordMessage;
|
||||
|
||||
|
@ -36,12 +36,19 @@ function startup(cb) {
|
|||
);
|
||||
}
|
||||
|
||||
function shutdown() {
|
||||
msgNetworkModules.forEach(mod => {
|
||||
mod.shutdown();
|
||||
function shutdown(cb) {
|
||||
async.each(
|
||||
msgNetworkModules,
|
||||
(msgNetModule, next) => {
|
||||
msgNetModule.shutdown( () => {
|
||||
return next();
|
||||
});
|
||||
|
||||
},
|
||||
() => {
|
||||
msgNetworkModules = [];
|
||||
return cb(null);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function recordMessage(message, cb) {
|
||||
|
|
Loading…
Reference in New Issue