-
Notifications
You must be signed in to change notification settings - Fork 48
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
Adding retries for **ANY** http request. #4
Conversation
Will always retry on 429, 500, 502, 503 and 504. Based on: https://cloud.google.com/storage/docs/json_api/v1/how-tos/resumable-upload#handling_errors
google/resumable_media/_helpers.py
Outdated
|
||
total_sleep = 0.0 | ||
num_retries = 0 | ||
while total_sleep < MAX_CUMULATIVE_RETRY: |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@jonparrott Requested re-factor has been done. PTAL |
google/resumable_media/_helpers.py
Outdated
Args: | ||
func (Callable): A callable that takes no arguments and produces | ||
a result which will be checked by ``predicate``. | ||
predicate (Callable): Determines if the result is valid. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
"""Determines if a ``response`` is retryable. | ||
|
||
Args: | ||
object: The return value of ``transport.request()``. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Will always retry on 429, 500, 502, 503 and 504. Based on:
https://cloud.google.com/storage/docs/json_api/v1/how-tos/resumable-upload#handling_errors