@smithy/util-retry
Advanced tools
Comparing version 3.0.8 to 3.0.9
@@ -87,3 +87,3 @@ var __defProp = Object.defineProperty; | ||
const delay = (amount - this.currentCapacity) / this.fillRate * 1e3; | ||
await new Promise((resolve) => setTimeout(resolve, delay)); | ||
await new Promise((resolve) => _DefaultRateLimiter.setTimeoutFn(resolve, delay)); | ||
} | ||
@@ -155,2 +155,6 @@ this.currentCapacity = this.currentCapacity - amount; | ||
__name(_DefaultRateLimiter, "DefaultRateLimiter"); | ||
/** | ||
* Only used in testing. | ||
*/ | ||
_DefaultRateLimiter.setTimeoutFn = setTimeout; | ||
var DefaultRateLimiter = _DefaultRateLimiter; | ||
@@ -157,0 +161,0 @@ |
@@ -35,3 +35,3 @@ import { isThrottlingError } from "@smithy/service-error-classification"; | ||
const delay = ((amount - this.currentCapacity) / this.fillRate) * 1000; | ||
await new Promise((resolve) => setTimeout(resolve, delay)); | ||
await new Promise((resolve) => DefaultRateLimiter.setTimeoutFn(resolve, delay)); | ||
} | ||
@@ -101,1 +101,2 @@ this.currentCapacity = this.currentCapacity - amount; | ||
} | ||
DefaultRateLimiter.setTimeoutFn = setTimeout; |
@@ -16,2 +16,6 @@ import { RateLimiter } from "./types"; | ||
export declare class DefaultRateLimiter implements RateLimiter { | ||
/** | ||
* Only used in testing. | ||
*/ | ||
private static setTimeoutFn; | ||
private beta; | ||
@@ -18,0 +22,0 @@ private minCapacity; |
@@ -16,2 +16,6 @@ import { RateLimiter } from "./types"; | ||
export declare class DefaultRateLimiter implements RateLimiter { | ||
/** | ||
* Only used in testing. | ||
*/ | ||
private static setTimeoutFn; | ||
private beta; | ||
@@ -18,0 +22,0 @@ private minCapacity; |
{ | ||
"name": "@smithy/util-retry", | ||
"version": "3.0.8", | ||
"version": "3.0.9", | ||
"description": "Shared retry utilities to be used in middleware packages.", | ||
@@ -18,3 +18,4 @@ "main": "./dist-cjs/index.js", | ||
"extract:docs": "api-extractor run --local", | ||
"test": "yarn g:jest" | ||
"test": "yarn g:vitest run", | ||
"test:watch": "yarn g:vitest watch" | ||
}, | ||
@@ -31,4 +32,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@smithy/service-error-classification": "^3.0.8", | ||
"@smithy/types": "^3.6.0", | ||
"@smithy/service-error-classification": "^3.0.9", | ||
"@smithy/types": "^3.7.0", | ||
"tslib": "^2.6.2" | ||
@@ -35,0 +36,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57578
1115
32
2
3
1
19