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 retryable http client and use in FGA module #356

Merged
merged 4 commits into from
Aug 12, 2024

Conversation

stanleyphu
Copy link
Contributor

Description

  • Adds httpretryable.HttpClient which implements the .Do method for making requests with built-in retry logic using exponential backoff.

  • Replaces the http client in the FGA module to use the retryable http client

Documentation

Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.

[ ] Yes

If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.

@stanleyphu stanleyphu requested a review from a team as a code owner August 6, 2024 22:35
This retryable client lives in a new `retryablehttp` package and implements a `Do` method that includes built-in retry logic. It implements exponential backoff and retries on request errors as well as 50X response codes.
The minimum delay time should be 250ms to account for the initial delay (500ms) with max negative jitter (250ms).
@stanleyphu stanleyphu force-pushed the feat/RetryableHttpClientInFGA branch from 7748dd1 to 9cae2d7 Compare August 12, 2024 22:15
@stanleyphu stanleyphu merged commit af890c2 into main Aug 12, 2024
2 checks passed
@stanleyphu stanleyphu deleted the feat/RetryableHttpClientInFGA branch August 12, 2024 22:26
@stanleyphu stanleyphu mentioned this pull request Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants