|
|
@ -14,6 +14,14 @@ const DEFAULT_QUERY_TIMEOUT = 60000 * 15; // increased from three to fifteen min
|
|
|
|
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));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var incrementTime = function (command, start) {
|
|
|
|
|
|
|
|
if (!command) { return; }
|
|
|
|
|
|
|
|
var end = +new Date();
|
|
|
|
|
|
|
|
var T = Env.commandTimers;
|
|
|
|
|
|
|
|
var diff = (end - start);
|
|
|
|
|
|
|
|
T[command] = (T[command] || 0) + (diff / 1000);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const workers = [];
|
|
|
|
const workers = [];
|
|
|
|
|
|
|
|
|
|
|
|
const response = Util.response(function (errLabel, info) {
|
|
|
|
const response = Util.response(function (errLabel, info) {
|
|
|
@ -112,7 +120,9 @@ Workers.initialize = function (Env, config, _cb) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const txid = guid();
|
|
|
|
const txid = guid();
|
|
|
|
|
|
|
|
var start = +new Date();
|
|
|
|
var cb = Util.once(Util.mkAsync(Util.both(_cb, function (err /*, value */) {
|
|
|
|
var cb = Util.once(Util.mkAsync(Util.both(_cb, function (err /*, value */) {
|
|
|
|
|
|
|
|
incrementTime(msg && msg.command, start);
|
|
|
|
if (err !== 'TIMEOUT') { return; }
|
|
|
|
if (err !== 'TIMEOUT') { return; }
|
|
|
|
Log.debug("WORKER_TIMEOUT_CAUSE", msg);
|
|
|
|
Log.debug("WORKER_TIMEOUT_CAUSE", msg);
|
|
|
|
// in the event of a timeout the user will receive an error
|
|
|
|
// in the event of a timeout the user will receive an error
|
|
|
|