@kronos-integration/interceptor 13.1.23 → 13.1.24
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.
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kronos-integration/interceptor",
|
|
3
|
-
"version": "13.1.
|
|
3
|
+
"version": "13.1.24",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
7
7
|
},
|
|
8
|
-
"packageManager": "npm@11.
|
|
8
|
+
"packageManager": "npm@11.9.0+sha512.04166853ddba142ca98f86fb57b1258a7c6c59ccb82acb3cf141b77a315898acaaed47395e74f7e0c7b69c486008e68be6a6381ef1aee5a23dd82e0e61decd68",
|
|
9
9
|
"types": "./types/index.d.mts",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
@@ -68,15 +68,12 @@ export class LimitingInterceptor extends Interceptor {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
async receive(endpoint, next, ...args) {
|
|
71
|
-
//console.log(`got #${this.ongoingRequests}`);
|
|
72
|
-
|
|
73
71
|
for (const limit of this.limits) {
|
|
74
72
|
if (this.ongoingRequests >= limit.count) {
|
|
75
73
|
if (limit.delay === undefined) {
|
|
76
|
-
throw new Error(`Limit of ongoing requests ${limit.count} reached
|
|
74
|
+
throw new Error(`Limit of ongoing requests ${limit.count} reached`,{ cause: this.ongoingRequests });
|
|
77
75
|
}
|
|
78
76
|
|
|
79
|
-
//console.log(`-> delay ${limit.delay}`);
|
|
80
77
|
this.ongoingRequests += 1;
|
|
81
78
|
|
|
82
79
|
return new Promise((resolve, reject) =>
|