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.cjs
CHANGED
|
@@ -1235,14 +1235,17 @@ var HealthChecker = class {
|
|
|
1235
1235
|
}
|
|
1236
1236
|
/**
|
|
1237
1237
|
* Mark a provider as degraded (e.g., on 429 error)
|
|
1238
|
+
*
|
|
1239
|
+
* Providers marked as degraded have failed health checks (e.g., rate limit errors)
|
|
1240
|
+
* and should not be selected. The system will failover to the next available provider.
|
|
1238
1241
|
*/
|
|
1239
1242
|
markDegraded(providerId, network, error) {
|
|
1240
1243
|
const key = this.getResultKey(providerId, network);
|
|
1241
1244
|
const existing = this.results.get(key);
|
|
1242
1245
|
const result = existing ? {
|
|
1243
1246
|
...existing,
|
|
1244
|
-
success:
|
|
1245
|
-
// Degraded providers
|
|
1247
|
+
success: false,
|
|
1248
|
+
// Degraded providers with errors should not be selected
|
|
1246
1249
|
status: "degraded",
|
|
1247
1250
|
error: error || "Marked as degraded",
|
|
1248
1251
|
lastTested: /* @__PURE__ */ new Date(),
|
|
@@ -1250,8 +1253,8 @@ var HealthChecker = class {
|
|
|
1250
1253
|
} : {
|
|
1251
1254
|
id: providerId,
|
|
1252
1255
|
network,
|
|
1253
|
-
success:
|
|
1254
|
-
// Degraded providers
|
|
1256
|
+
success: false,
|
|
1257
|
+
// Degraded providers with errors should not be selected
|
|
1255
1258
|
status: "degraded",
|
|
1256
1259
|
latencyMs: null,
|
|
1257
1260
|
seqno: null,
|