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

Feature/1595 retryable http client #128

Merged
merged 8 commits into from
Jun 20, 2024
Merged

Conversation

tuj
Copy link
Contributor

@tuj tuj commented Jun 6, 2024

Link to ticket

https://leantime.itkdev.dk/#/tickets/showTicket/1595

Description

Added retryable http client decorator for handling rate limiting.

Checklist

  • My code is covered by test cases.
  • My code passes our test (all our tests).
  • My code passes our static analysis suite.
  • My code passes our continuous integration process.

@tuj tuj added the enhancement New feature or request label Jun 6, 2024
@tuj tuj self-assigned this Jun 6, 2024
@tuj tuj requested a review from rimi-itk June 6, 2024 11:18
Copy link
Contributor

@rimi-itk rimi-itk left a comment

Choose a reason for hiding this comment

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

Approved with a single suggestion.

@@ -49,8 +53,10 @@ public function getService(DataProvider $dataProvider): DataProviderServiceInter
'auth_basic' => $dataProvider->getSecret(),
]);

$retryableHttpClient = new RetryableHttpClient($client, new GenericRetryStrategy([429], $this->httpClientRetryDelayMs, 1.0), $this->httpClientMaxRetries);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
$retryableHttpClient = new RetryableHttpClient($client, new GenericRetryStrategy([429], $this->httpClientRetryDelayMs, 1.0), $this->httpClientMaxRetries);
$retryableHttpClient = new RetryableHttpClient($client, new GenericRetryStrategy([Response::HTTP_CONFLICT], $this->httpClientRetryDelayMs, 1.0), $this->httpClientMaxRetries);

@tuj tuj merged commit b0bad8d into develop Jun 20, 2024
9 checks passed
@tuj tuj deleted the feature/1595-retryable-http-client branch June 20, 2024 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants