Skip to content

Conversation

@maia-yeager
Copy link

This pull request adds a feature to allow the Autotask client to automatically retry any requests that were rate-limited (i.e. receives the 429 HTTP code, per Autotask's documentation).

The retry will exponentially back off between attempts on subsequent rate limits for the same request. Once it reaches the specified maximum number of retries, it will return the errored request object back to the API client's _fetch method for handling like normal.

This is done by wrapping the fetch built-in function within the _fetch client method. It's enabled by default, but if someone needs the old functionality for whatever reason, they can disable it when initializing the client class.

Tests have been added to ensure the functionality works as intended and can be disabled, as well as ensuring that no existing tests have broken (including error handling).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant