@resolveio/server-lib 1.1.12 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -345,6 +345,11 @@ var MethodManager = /** @class */ (function () {
|
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
|
+
var timeout = setTimeout(function () {
|
|
349
|
+
console.error('Timeout on method', update);
|
|
350
|
+
_this.callMethodInternal.call(_this, 'insertErrorLog', 'Timeout on method: ', [update]);
|
|
351
|
+
reject('Timeout');
|
|
352
|
+
}, 10000);
|
|
348
353
|
// console.log('Run Method', update.method);
|
|
349
354
|
(_a = that._methods[update.method].function).call.apply(_a, [Object.assign({}, that, MethodManager.prototype, { id_user: update.id_user, user: update.user, id_ws: update.id_ws })].concat(update.method_data)).then(function (res) {
|
|
350
355
|
var serverRes = {
|
|
@@ -353,6 +358,7 @@ var MethodManager = /** @class */ (function () {
|
|
|
353
358
|
data: res
|
|
354
359
|
};
|
|
355
360
|
_this._mainServer.getQueueManager().addMethodResponse(updateCopy, serverRes);
|
|
361
|
+
clearTimeout(timeout);
|
|
356
362
|
resolve(serverRes);
|
|
357
363
|
}, function (err) {
|
|
358
364
|
var serverRes = {
|
|
@@ -361,6 +367,7 @@ var MethodManager = /** @class */ (function () {
|
|
|
361
367
|
data: err
|
|
362
368
|
};
|
|
363
369
|
_this._mainServer.getQueueManager().addMethodResponse(updateCopy, serverRes);
|
|
370
|
+
clearTimeout(timeout);
|
|
364
371
|
reject(serverRes);
|
|
365
372
|
});
|
|
366
373
|
});
|