Skip to content

Conversation

@gtpaulose
Copy link
Contributor

A really simple option so folks can set the retry options with easy and less verbosity in their code.

@codecov
Copy link

codecov bot commented Oct 30, 2020

Codecov Report

Merging #384 (e579a9b) into master (0adbe55) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #384      +/-   ##
==========================================
+ Coverage   95.97%   95.99%   +0.01%     
==========================================
  Files          10       10              
  Lines        1019     1023       +4     
==========================================
+ Hits          978      982       +4     
  Misses         23       23              
  Partials       18       18              
Impacted Files Coverage Δ
client.go 96.82% <100.00%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0adbe55...e579a9b. Read the comment docs.

Copy link
Member

@jeevatkm jeevatkm left a comment

Choose a reason for hiding this comment

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

@gtpaulose Thanks for the PR, surely this handy for the resty users.

Please take a look at a couple of comments.

// an error from the http response
func (c *Client) AddRetryAfterErrorCondition() *Client {
c.AddRetryCondition(func(response *Response, err error) bool {
if response.IsError() {
Copy link
Member

Choose a reason for hiding this comment

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

@gtpaulose can you please add a test case for success and failure flow of new condition?
More info: https://codecov.io/gh/go-resty/resty/pull/384/diff?src=pr&el=tree#diff-Y2xpZW50Lmdv

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey did you mean the test case for 'refiring under an error and non error scenario (i.e response.IsError() == true and response.IsError() == false )? '

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes

Copy link
Contributor Author

@gtpaulose gtpaulose Nov 2, 2020

Choose a reason for hiding this comment

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

Alright, ive added the test case. Ive reused an existing path in the createGetServer() switch case, hope thats okay!

@gtpaulose
Copy link
Contributor Author

Is there anymore changes required?

Copy link
Member

@jeevatkm jeevatkm left a comment

Choose a reason for hiding this comment

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

@gtpaulose Thanks for the updates and for taking care of the review comments.
I'm really sorry for the delay, due to personal reasons.

@jeevatkm jeevatkm added this to the v2.6.0 Milestone milestone Mar 20, 2021
@jeevatkm jeevatkm merged commit c9326c6 into go-resty:master Mar 20, 2021
@jeevatkm jeevatkm added the v2 For resty v2 label Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement v2 For resty v2

Development

Successfully merging this pull request may close these issues.

3 participants