Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some of the graph APIs do not provide the `retry-after` header in HTTP 429 throttling responses. The default behavior of this SDK is to retry 3 times, with exponential backoff. The problem with this approach is that the max retry of 3 attempts (with a delay of ~8 seconds) just isn't enough for some APIs. For example, OneNote's API will potentially return 429s for 1 hour. To fix this, let us create some new defaults: | Thing | Old Value | New Value | Reasoning | | ------------------- | ----------- | -------------- | ------------------------------------------------------------------------------------------------------------------------- | | DEFAULT_MAX_RETRIES | 3 | 12 | 2^12 seconds is just over 1 hour, which should be enough for OneNote | | MAX_DELAY | 180 seconds | 3_600 (1 hour) | This makes it so that retry 12+ only wait 1 hour between retries instead of continuing to backoff the delay exponentially | | MAX_MAX_RETRIES | 10 | 64 | This needs to be higher than DEFAULT_MAX_RETRIES but the choice of 64 is arbitrary | See [this GitHub issue](#978) for more discussion.
- Loading branch information