Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add retry functionality for management api requests #215

Merged
merged 4 commits into from
Nov 8, 2017

Conversation

dctoon
Copy link
Contributor

@dctoon dctoon commented Oct 20, 2017

This PR's provides a RetryRestClient, that retries failed request due to rate-limits again.

The requests are retried when the setting retry.enabled is set to true and will only retry requests when the status code is 429 and the response headers contains the specific rate limit header x-ratelimit-limit.

By default retry is enabled, changing this can be done as follows;

var managementClient = new ManagementClient({
  clientId: '',
  clientSecret: '',
  domain: 'xxx.auth0.com',
  retry: {
    enabled : true
  }
});

@cocojoe cocojoe self-requested a review October 24, 2017 08:43
Copy link
Member

@cocojoe cocojoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM in general. Although this is a change in behaviour, I think having it on by default is good for the vast majority of developers. Just add some notes to README to make it clear for upgrade that this exists and how it can be disabled.

@cocojoe cocojoe requested review from luisrudge and hzalaz October 24, 2017 08:45
@cocojoe
Copy link
Member

cocojoe commented Oct 24, 2017

#103 #208

hzalaz
hzalaz previously approved these changes Nov 8, 2017
@hzalaz hzalaz merged commit f97527e into auth0:master Nov 8, 2017
@hzalaz hzalaz added this to the v2.9.0 milestone Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants