@hmcts/ccd-case-ui-toolkit 6.19.0-RetryCaseRetrievals.2 → 6.19.0-RetryCaseRetrievals.3

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.
@@ -8089,11 +8089,11 @@
8089
8089
  var RetryUtil = /** @class */ (function () {
8090
8090
  function RetryUtil() {
8091
8091
  this.artificialDelayOn = true;
8092
- this.artificialDelayPeriod = Math.random() > 0.5 ? 60 : 3;
8092
+ this.artificialDelayPeriod = this.pickARandomValue();
8093
8093
  }
8094
8094
  RetryUtil.prototype.switchArtificialDelays = function (status) {
8095
8095
  this.artificialDelayOn = status;
8096
- this.artificialDelayPeriod = Math.random() > 0.5 ? 60 : 2;
8096
+ this.artificialDelayPeriod = this.pickARandomValue();
8097
8097
  };
8098
8098
  RetryUtil.prototype.switchOnArtificialDelays = function () {
8099
8099
  this.switchArtificialDelays(true);
@@ -8150,6 +8150,9 @@
8150
8150
  }));
8151
8151
  return out$;
8152
8152
  };
8153
+ RetryUtil.prototype.pickARandomValue = function () {
8154
+ return Date.now() % 2 == 0 ? 60 : 3;
8155
+ };
8153
8156
  return RetryUtil;
8154
8157
  }());
8155
8158
  RetryUtil.ɵfac = function RetryUtil_Factory(t) { return new (t || RetryUtil)(); };