Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
FallbackProvider.prototype.perform = function (method, params) {
var _this = this;
var T0 = now();
var runners = (random_1.shuffled(this.providers)).map(function (provider, i) {
var weight = _this.weights[i];
var rid = nextRid++;
return {
run: function () {
var t0 = now();
var start = t0 - T0;
_this.emit("debug", {
action: "request",
rid: rid,
backend: { weight: weight, start: start, provider: provider },
request: { method: method, params: properties_1.deepCopy(params) },
provider: _this
});
return FallbackProvider.doPerform(provider, method, params).then(function (result) {
var duration = now() - t0;
_this.emit("debug", {