ntk-cms-api 1.2.241 → 1.2.242

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.
@@ -1690,6 +1690,14 @@ class ApiCmsServerBase extends ApiServerBase {
1690
1690
  if (this.getModuleCashService().includes(serviceName)) {
1691
1691
  if (this.cashApiIsValid(serviceNameKay))
1692
1692
  return of(this.cachApiResult[serviceNameKay]);
1693
+ if (this.cachApiCallDate[serviceNameKay]) {
1694
+ const startDate = new Date();
1695
+ while ((new Date().getTime() - startDate.getTime()) < this.cashApiSeconds) {
1696
+ if (this.cashApiIsValid(serviceNameKay))
1697
+ return of(this.cachApiResult[serviceNameKay]);
1698
+ }
1699
+ }
1700
+ this.cachApiCallDate[serviceNameKay] = true;
1693
1701
  }
1694
1702
  //! optimaze call api
1695
1703
  // this.loadingStatus=true;
@@ -1704,6 +1712,7 @@ class ApiCmsServerBase extends ApiServerBase {
1704
1712
  if (this.getModuleCashService().includes(serviceName)) {
1705
1713
  this.cachApiResult[serviceNameKay] = ret;
1706
1714
  this.cachApiResult[serviceNameKay].dateResult = new Date();
1715
+ this.cachApiCallDate[serviceNameKay] = false;
1707
1716
  }
1708
1717
  //! optimaze call api
1709
1718
  return this.errorExceptionResultCheck(ret);
@@ -2158,6 +2167,14 @@ class CoreEnumService extends ApiServerBase {
2158
2167
  if (this.getModuleCashService().includes(serviceName)) {
2159
2168
  if (this.cashApiIsValid(serviceNameKay))
2160
2169
  return of(this.cachApiResult[serviceNameKay]);
2170
+ if (this.cachApiCallDate[serviceNameKay]) {
2171
+ const startDate = new Date();
2172
+ while ((new Date().getTime() - startDate.getTime()) < this.cashApiSeconds) {
2173
+ if (this.cashApiIsValid(serviceNameKay))
2174
+ return of(this.cachApiResult[serviceNameKay]);
2175
+ }
2176
+ }
2177
+ this.cachApiCallDate[serviceNameKay] = true;
2161
2178
  }
2162
2179
  //! optimaze call api
2163
2180
  return this.http
@@ -2171,6 +2188,7 @@ class CoreEnumService extends ApiServerBase {
2171
2188
  if (this.getModuleCashService().includes(serviceName)) {
2172
2189
  this.cachApiResult[serviceNameKay] = ret;
2173
2190
  this.cachApiResult[serviceNameKay].dateResult = new Date();
2191
+ this.cachApiCallDate[serviceNameKay] = false;
2174
2192
  }
2175
2193
  //! optimaze call api
2176
2194
  return this.errorExceptionResultCheck(ret);