First pass formatting with Prettier
* Added .prettierrc.json * Added .prettierignore * Formatted
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
'use strict';
|
||||
|
||||
// ENiGMA½
|
||||
const loadModulesForCategory = require('./module_util.js').loadModulesForCategory;
|
||||
const loadModulesForCategory = require('./module_util.js').loadModulesForCategory;
|
||||
|
||||
// standard/deps
|
||||
const async = require('async');
|
||||
const async = require('async');
|
||||
|
||||
exports.startup = startup;
|
||||
exports.shutdown = shutdown;
|
||||
exports.recordMessage = recordMessage;
|
||||
exports.startup = startup;
|
||||
exports.shutdown = shutdown;
|
||||
exports.recordMessage = recordMessage;
|
||||
|
||||
let msgNetworkModules = [];
|
||||
|
||||
@@ -17,19 +17,23 @@ function startup(cb) {
|
||||
async.series(
|
||||
[
|
||||
function loadModules(callback) {
|
||||
loadModulesForCategory('scannerTossers', (module, nextModule) => {
|
||||
const modInst = new module.getModule();
|
||||
loadModulesForCategory(
|
||||
'scannerTossers',
|
||||
(module, nextModule) => {
|
||||
const modInst = new module.getModule();
|
||||
|
||||
modInst.startup(err => {
|
||||
if(!err) {
|
||||
msgNetworkModules.push(modInst);
|
||||
}
|
||||
});
|
||||
return nextModule(null);
|
||||
}, err => {
|
||||
callback(err);
|
||||
});
|
||||
}
|
||||
modInst.startup(err => {
|
||||
if (!err) {
|
||||
msgNetworkModules.push(modInst);
|
||||
}
|
||||
});
|
||||
return nextModule(null);
|
||||
},
|
||||
err => {
|
||||
callback(err);
|
||||
}
|
||||
);
|
||||
},
|
||||
],
|
||||
cb
|
||||
);
|
||||
@@ -39,7 +43,7 @@ function shutdown(cb) {
|
||||
async.each(
|
||||
msgNetworkModules,
|
||||
(msgNetModule, next) => {
|
||||
msgNetModule.shutdown( () => {
|
||||
msgNetModule.shutdown(() => {
|
||||
return next();
|
||||
});
|
||||
},
|
||||
@@ -56,10 +60,14 @@ function recordMessage(message, cb) {
|
||||
// a chance to do something with |message|. Any or all can
|
||||
// choose to ignore it.
|
||||
//
|
||||
async.each(msgNetworkModules, (modInst, next) => {
|
||||
modInst.record(message);
|
||||
next();
|
||||
}, err => {
|
||||
cb(err);
|
||||
});
|
||||
}
|
||||
async.each(
|
||||
msgNetworkModules,
|
||||
(modInst, next) => {
|
||||
modInst.record(message);
|
||||
next();
|
||||
},
|
||||
err => {
|
||||
cb(err);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user