ton-provider-system 0.2.0 → 0.2.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/index.cjs +7 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1032,6 +1032,9 @@ declare class HealthChecker {
|
|
|
1032
1032
|
clearResults(): void;
|
|
1033
1033
|
/**
|
|
1034
1034
|
* Mark a provider as degraded (e.g., on 429 error)
|
|
1035
|
+
*
|
|
1036
|
+
* Providers marked as degraded have failed health checks (e.g., rate limit errors)
|
|
1037
|
+
* and should not be selected. The system will failover to the next available provider.
|
|
1035
1038
|
*/
|
|
1036
1039
|
markDegraded(providerId: string, network: Network, error?: string): void;
|
|
1037
1040
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1032,6 +1032,9 @@ declare class HealthChecker {
|
|
|
1032
1032
|
clearResults(): void;
|
|
1033
1033
|
/**
|
|
1034
1034
|
* Mark a provider as degraded (e.g., on 429 error)
|
|
1035
|
+
*
|
|
1036
|
+
* Providers marked as degraded have failed health checks (e.g., rate limit errors)
|
|
1037
|
+
* and should not be selected. The system will failover to the next available provider.
|
|
1035
1038
|
*/
|
|
1036
1039
|
markDegraded(providerId: string, network: Network, error?: string): void;
|
|
1037
1040
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1232,14 +1232,17 @@ var HealthChecker = class {
|
|
|
1232
1232
|
}
|
|
1233
1233
|
/**
|
|
1234
1234
|
* Mark a provider as degraded (e.g., on 429 error)
|
|
1235
|
+
*
|
|
1236
|
+
* Providers marked as degraded have failed health checks (e.g., rate limit errors)
|
|
1237
|
+
* and should not be selected. The system will failover to the next available provider.
|
|
1235
1238
|
*/
|
|
1236
1239
|
markDegraded(providerId, network, error) {
|
|
1237
1240
|
const key = this.getResultKey(providerId, network);
|
|
1238
1241
|
const existing = this.results.get(key);
|
|
1239
1242
|
const result = existing ? {
|
|
1240
1243
|
...existing,
|
|
1241
|
-
success:
|
|
1242
|
-
// Degraded providers
|
|
1244
|
+
success: false,
|
|
1245
|
+
// Degraded providers with errors should not be selected
|
|
1243
1246
|
status: "degraded",
|
|
1244
1247
|
error: error || "Marked as degraded",
|
|
1245
1248
|
lastTested: /* @__PURE__ */ new Date(),
|
|
@@ -1247,8 +1250,8 @@ var HealthChecker = class {
|
|
|
1247
1250
|
} : {
|
|
1248
1251
|
id: providerId,
|
|
1249
1252
|
network,
|
|
1250
|
-
success:
|
|
1251
|
-
// Degraded providers
|
|
1253
|
+
success: false,
|
|
1254
|
+
// Degraded providers with errors should not be selected
|
|
1252
1255
|
status: "degraded",
|
|
1253
1256
|
latencyMs: null,
|
|
1254
1257
|
seqno: null,
|