ton-provider-system 0.1.4 → 0.1.5
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 +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1367,6 +1367,7 @@ var TokenBucketRateLimiter = class {
|
|
|
1367
1367
|
);
|
|
1368
1368
|
}
|
|
1369
1369
|
this.tokens = 0;
|
|
1370
|
+
this.lastRefill = Date.now();
|
|
1370
1371
|
this.logger.warn(`Rate limit hit, backoff: ${this.currentBackoff}ms, errors: ${this.consecutiveErrors}`);
|
|
1371
1372
|
}
|
|
1372
1373
|
/**
|
|
@@ -1899,7 +1900,8 @@ var _ProviderManager = class _ProviderManager {
|
|
|
1899
1900
|
this.rateLimiter = createRateLimiterManager(this.options.logger);
|
|
1900
1901
|
for (const provider of this.registry.getAllProviders()) {
|
|
1901
1902
|
const config2 = getRateLimitForType(provider.type);
|
|
1902
|
-
const
|
|
1903
|
+
const bufferMultiplier = provider.rps <= 3 ? 1.2 : 1.1;
|
|
1904
|
+
const minDelayMs = Math.ceil(1e3 / provider.rps * bufferMultiplier);
|
|
1903
1905
|
let burstSize;
|
|
1904
1906
|
if (provider.rps <= 3) {
|
|
1905
1907
|
burstSize = 1;
|