-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[HttpClient] Add max_retries
setting docs on the RetryableHttpClient
#18288
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
Merged
OskarStark
merged 1 commit into
symfony:6.4
from
danielburger1337:max-retries-RetryableHttpClient
Jun 9, 2023
Merged
[HttpClient] Add max_retries
setting docs on the RetryableHttpClient
#18288
OskarStark
merged 1 commit into
symfony:6.4
from
danielburger1337:max-retries-RetryableHttpClient
Jun 9, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
max_retries
setting docs on the RetryableHttpClient
nicolas-grekas
added a commit
to symfony/symfony
that referenced
this pull request
Jun 9, 2023
…pClient` (danielburger1337) This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [HttpClient] Add `max_retries` option to `RetryableHttpClient` | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | symfony/symfony-docs#18288 Added a `max_retries` option to RetryableHttpClient that allows the user to configure the RetryableHttpClient on a per request level, which is especially useful when `retry_failed` was configured for the global `http_client` service. ```php <?php use Symfony\Component\HttpClient\HttpClient; use Symfony\Component\HttpClient\RetryableHttpClient; $client = HttpClient::create(); $client = new RetryableHttpClient($client, null, 3); $client->request('GET', '/foo-bar', [ 'max_retries' => 1 // 0 disables retrying ]); // $client = $client->withOptions(['max_retries' => 1]); ``` Commits ------- 496ba59 [HttpClient] Add `max_retries` option to `RetryableHttpClient`
symfony-splitter
pushed a commit
to symfony/http-client
that referenced
this pull request
Jun 9, 2023
…pClient` (danielburger1337) This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [HttpClient] Add `max_retries` option to `RetryableHttpClient` | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | symfony/symfony-docs#18288 Added a `max_retries` option to RetryableHttpClient that allows the user to configure the RetryableHttpClient on a per request level, which is especially useful when `retry_failed` was configured for the global `http_client` service. ```php <?php use Symfony\Component\HttpClient\HttpClient; use Symfony\Component\HttpClient\RetryableHttpClient; $client = HttpClient::create(); $client = new RetryableHttpClient($client, null, 3); $client->request('GET', '/foo-bar', [ 'max_retries' => 1 // 0 disables retrying ]); // $client = $client->withOptions(['max_retries' => 1]); ``` Commits ------- 496ba59b4f [HttpClient] Add `max_retries` option to `RetryableHttpClient`
OskarStark
reviewed
Jun 9, 2023
@@ -713,7 +717,8 @@ By default, failed requests are retried up to 3 times, with an exponential delay | |||
between retries (first retry = 1 second; third retry: 4 seconds) and only for | |||
the following HTTP status codes: ``423``, ``425``, ``429``, ``502`` and ``503`` | |||
when using any HTTP method and ``500``, ``504``, ``507`` and ``510`` when using | |||
an HTTP `idempotent method`_. | |||
an HTTP `idempotent method`_. Use the ``max_retries`` setting to configure the amount | |||
of times a request is retried. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
of times a request is retried. | |
of time a request is retried. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (but that should target 6.4)
Thanks for your work on this new feature! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
References #50240