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

Allow specifying methods that bypass :retry_if on Request::Retry #437

Conversation

mike-bourgeous
Copy link
Contributor

This expands the IDEMPOTENT_METHODS functionality to allow speifying the
methods that will be retried without calling :retry_if. The new :methods option
to Request::Retry allows :retry_if to be called for every HTTP method, a user-
specified set of HTTP methods, or never.

It's likely that :retry_if, IDEMPOTENT_METHODS, and :methods could be
combined into a simpler API (such as by changing the :retry_if default value to
check for an idempotent method), but this separate approach preserves the
existing behavior if :methods is not specified.

Tests and documentation are included in the pull request; I ran the tests against
Ruby 2.1.3 and Ruby 1.8.7.

@rusikf
Copy link

rusikf commented Nov 26, 2014

Faraday::Request::Retry

is not needed, please merge my pull-request to your fork here.

…nt-methods

clean constant IDEMPOTENT_METHODS
@mike-bourgeous
Copy link
Contributor Author

@rusikf Merged your PR, thanks.

@mike-bourgeous
Copy link
Contributor Author

Do I need to provide any more info or changes for this pull request?

technoweenie added a commit that referenced this pull request Jan 7, 2015
…dempotent-methods

Allow specifying methods that bypass :retry_if on Request::Retry
@technoweenie technoweenie merged commit 6262970 into lostisland:master Jan 7, 2015
@technoweenie
Copy link
Member

Thanks for the patch! Just FYI, I'm replacing Faraday with a new lib: Hurley. #454

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants