aws-sdk-js-codemod icon indicating copy to clipboard operation
aws-sdk-js-codemod copied to clipboard

[Feature]: Use codemod to convert RetryDelayOptions

Open abhirpat opened this issue 2 years ago • 2 comments
trafficstars

Self-service

  • [ ] I'd be willing to implement this feature

Problem

    AWS.config.update({
        maxRetries: request_params.maxRetries,
        retryDelayOptions: {
            base: request_params.retryDelay,
        },
    })

Solution

Requesting codemod to convert retryDelayOptions as they are deprecated in SDK V3 clients.

Alternatives

I have used ConfiguredRetryStrategy however I noticed some calls are not getting executed. Initially I had throttling error so I added + 1. After that I don't see any error. Thus, it would be helpful to have codemod show correct transalation or update SDK documentation. I am submitting this feature request per our discussion.

request_params.maxRetries = 8 request_params.retryDelay = 600

    const maxRetries = request_params.maxRetries;
    const base = request_params.retryDelay;
    const retryStrategy = new ConfiguredRetryStrategy(maxRetries + 1, base);

Additional context

No response

abhirpat avatar Oct 17 '23 17:10 abhirpat

As of >0.25.0, we add a comment to assist tranform retryDelayOptions

Example: https://github.com/awslabs/aws-sdk-js-codemod/blob/main/src/transforms/v2-to-v3/fixtures/config/retryDelayOptions.output.js

trivikr avatar Oct 26 '23 17:10 trivikr

As of >0.25.0, we add a comment to assist tranform retryDelayOptions

Example: https://github.com/awslabs/aws-sdk-js-codemod/blob/main/src/transforms/v2-to-v3/fixtures/config/retryDelayOptions.output.js

However, this documentation doesn't clarify how to convert retryDelayOptions with example for base

abhirpat avatar Oct 27 '23 23:10 abhirpat