-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathmain.js
37 lines (32 loc) · 1009 Bytes
/
main.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
32
33
34
35
36
37
// Maxstagram
// ==========
//
// A flexible, continuous image processing web service.
//
var argv = require('minimist')(process.argv.slice(2))
, util = require('./util')
;
function main() {
// Load configuration and initialize application
var config = util.mergeInto(require('./config'), argv);
// In a test configuration, override parameters with their _test versions.
for (var key in config)
if (key.match(/_test$/)) {
if (config.test !== 'false')
config[key.substr(0, key.length-5)] = config[key];
delete config[key];
}
// Initialize this process
util.init(config, function (err) {
if (err) throw err;
// Load process modules
util.launch('processes/WebServer', config, {
exponential_backoff: true,
log_events: true,
});
util.launch('processes/UploadIngester', config);
util.launch('processes/ImageProcessor', config);
util.launch('processes/NotificationSender', config);
});
}
if (require.main === module) main();