|
|
@ -8,7 +8,7 @@ const Workers = module.exports;
|
|
|
|
const PID = process.pid;
|
|
|
|
const PID = process.pid;
|
|
|
|
|
|
|
|
|
|
|
|
const DB_PATH = 'lib/workers/db-worker';
|
|
|
|
const DB_PATH = 'lib/workers/db-worker';
|
|
|
|
const MAX_JOBS = 16;
|
|
|
|
const MAX_JOBS = 8;
|
|
|
|
|
|
|
|
|
|
|
|
Workers.initialize = function (Env, config, _cb) {
|
|
|
|
Workers.initialize = function (Env, config, _cb) {
|
|
|
|
var cb = Util.once(Util.mkAsync(_cb));
|
|
|
|
var cb = Util.once(Util.mkAsync(_cb));
|
|
|
@ -97,7 +97,7 @@ Workers.initialize = function (Env, config, _cb) {
|
|
|
|
// track which worker is doing which jobs
|
|
|
|
// track which worker is doing which jobs
|
|
|
|
state.tasks[txid] = msg;
|
|
|
|
state.tasks[txid] = msg;
|
|
|
|
|
|
|
|
|
|
|
|
response.expect(txid, cb, 60000);
|
|
|
|
response.expect(txid, cb, 180000);
|
|
|
|
state.worker.send(msg);
|
|
|
|
state.worker.send(msg);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|