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

Adding retries for **ANY** http request. #4

Merged
merged 3 commits into from
Apr 24, 2017

Conversation

dhermes
Copy link
Contributor

@dhermes dhermes commented Apr 24, 2017

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


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.

This comment was marked as spam.

@dhermes
Copy link
Contributor Author

dhermes commented Apr 24, 2017

@jonparrott Requested re-factor has been done. PTAL

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.

"""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.

@dhermes dhermes merged commit 7155384 into googleapis:master Apr 24, 2017
@dhermes dhermes deleted the add-retries branch April 24, 2017 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants