@aws-sdk/util-retry
Advanced tools
Comparing version 3.329.0 to 3.337.0
{ | ||
"name": "@aws-sdk/util-retry", | ||
"version": "3.329.0", | ||
"version": "3.337.0", | ||
"description": "Shared retry utilities to be used in middleware packages.", | ||
@@ -27,7 +27,7 @@ "main": "./dist-cjs/index.js", | ||
"dependencies": { | ||
"@aws-sdk/service-error-classification": "3.329.0", | ||
"@aws-sdk/service-error-classification": "3.337.0", | ||
"tslib": "^2.5.0" | ||
}, | ||
"devDependencies": { | ||
"@aws-sdk/types": "3.329.0", | ||
"@aws-sdk/types": "3.337.0", | ||
"@tsconfig/recommended": "1.0.1", | ||
@@ -34,0 +34,0 @@ "@types/node": "^14.14.31", |
@@ -25,12 +25,8 @@ # @aws-sdk/util-retry | ||
If you want to change the number of attempts, you can use the `StandardRetryStrategy` from `@aws-sdk/util-retry`. | ||
If you want to change the number of attempts, you can provide `maxAttempts` configuration during client creation. | ||
```js | ||
import { S3Client } from "@aws-sdk/client-s3"; | ||
import { StandardRetryStrategy } from "@aws-sdk/util-retry"; | ||
const client = new S3Client({ | ||
// custom max number of attempts. | ||
retryStrategy: new StandardRetryStrategy(4), | ||
}); | ||
const client = new S3Client({ maxAttempts: 4 }); | ||
``` | ||
@@ -60,2 +56,20 @@ | ||
### MaxAttempts and RetryStrategy | ||
If you provide both `maxAttempts` and `retryStrategy`, the `retryStrategy` will | ||
get precedence as it's more specific. | ||
```js | ||
import { S3Client } from "@aws-sdk/client-s3"; | ||
import { ConfiguredRetryStrategy } from "@aws-sdk/util-retry"; | ||
const client = new S3Client({ | ||
maxAttempts: 2, // ignored. | ||
retryStrategy: new ConfiguredRetryStrategy( | ||
4, // used. | ||
(attempt: number) => 100 + attempt * 1000 // backoff function. | ||
), | ||
}); | ||
``` | ||
### Further customization | ||
@@ -62,0 +76,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
55113
78
+ Added@aws-sdk/service-error-classification@3.337.0(transitive)
- Removed@aws-sdk/service-error-classification@3.329.0(transitive)