-
Notifications
You must be signed in to change notification settings - Fork 35
/
app.js
executable file
·31 lines (25 loc) · 928 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
process.title = 'aggie';
var processManager = require('./lib/process-manager');
var initLogger = require('./lib/master-logger').init;
var log = require('./lib/master-logger').log;
// fork child at specific module path
function _fork(modulePath) {
var child = processManager.fork(modulePath);
initLogger(child.moduleName);
log(child.moduleName, 'debug', 'Aggie started');
}
// initialize master logger
var masterLoggerName = 'master';
initLogger(masterLoggerName);
log(masterLoggerName, 'debug', 'Aggie started');
// handle uncaught exceptions
process.on('uncaughtException', function(err) {
log(masterLoggerName, 'error', err.message);
log(masterLoggerName, 'debug', err.stack);
});
// Begins the three main app processes API, fetching, and analytics.
// See Readme files in lib subdirectores for more on each.
_fork('/lib/api');
_fork('/lib/fetching');
_fork('/lib/analytics');
module.exports = processManager;