@digilogiclabs/platform-core 1.28.0 → 1.28.1
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/dist/auth.d.mts +2 -2
- package/dist/auth.d.ts +2 -2
- package/dist/auth.js +18 -5
- package/dist/auth.js.map +1 -1
- package/dist/auth.mjs +18 -5
- package/dist/auth.mjs.map +1 -1
- package/dist/{env-Cgwf8ZG2.d.mts → env-CHg-CUuD.d.mts} +6 -0
- package/dist/{env-Cgwf8ZG2.d.ts → env-CHg-CUuD.d.ts} +6 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +23 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -19526,11 +19526,24 @@ async function checkRateLimit(operation, identifier, rule, options = {}) {
|
|
|
19526
19526
|
retryAfterSeconds: 0
|
|
19527
19527
|
};
|
|
19528
19528
|
} catch (error) {
|
|
19529
|
-
options.logger?.error(
|
|
19530
|
-
|
|
19531
|
-
|
|
19532
|
-
|
|
19533
|
-
|
|
19529
|
+
options.logger?.error(
|
|
19530
|
+
rule.failClosed ? "Rate limit check failed, denying request (fail-closed rule)" : "Rate limit check failed, allowing request",
|
|
19531
|
+
{
|
|
19532
|
+
error: error instanceof Error ? error.message : String(error),
|
|
19533
|
+
operation,
|
|
19534
|
+
identifier
|
|
19535
|
+
}
|
|
19536
|
+
);
|
|
19537
|
+
if (rule.failClosed) {
|
|
19538
|
+
return {
|
|
19539
|
+
allowed: false,
|
|
19540
|
+
remaining: 0,
|
|
19541
|
+
resetAt,
|
|
19542
|
+
current: 0,
|
|
19543
|
+
limit,
|
|
19544
|
+
retryAfterSeconds: 30
|
|
19545
|
+
};
|
|
19546
|
+
}
|
|
19534
19547
|
return {
|
|
19535
19548
|
allowed: true,
|
|
19536
19549
|
remaining: limit,
|
|
@@ -33283,9 +33296,12 @@ function createRedisClient(options) {
|
|
|
33283
33296
|
const client = new Redis(url, {
|
|
33284
33297
|
keyPrefix,
|
|
33285
33298
|
maxRetriesPerRequest: maxRetries,
|
|
33299
|
+
// Never give up reconnecting. Returning null here ends the connection
|
|
33300
|
+
// for good, and a long-lived singleton (rate limiting, caching) would
|
|
33301
|
+
// then stay broken until the process restarts. maxRetriesPerRequest
|
|
33302
|
+
// still makes individual commands fail fast while disconnected.
|
|
33286
33303
|
retryStrategy(times) {
|
|
33287
|
-
|
|
33288
|
-
return Math.min(times * 200, 2e3);
|
|
33304
|
+
return Math.min(times * 200, 5e3);
|
|
33289
33305
|
},
|
|
33290
33306
|
lazyConnect
|
|
33291
33307
|
});
|