Skip to content

max retry limit fix#5

Open
avisnakovs wants to merge 1 commit into
matryer:masterfrom
avisnakovs:master
Open

max retry limit fix#5
avisnakovs wants to merge 1 commit into
matryer:masterfrom
avisnakovs:master

Conversation

@avisnakovs
Copy link
Copy Markdown

@avisnakovs avisnakovs commented Sep 21, 2018

There was two places with max retry limit logic :

  1. variable try.MaxRetries
  2. callback fn(attempt) return value (cont)

Second only worked if attempt number was less than MaxRetries number, though error message didn't say that max retry limit reached. To change number of max retries you should mutate internal library variable which is not good practice. So I deleted logic with variable try.MaxRetries and fixed logic with callback return value.

Also exceeded MaxRetriesReached error is a little bit more informative.

In conclusion having two places where you should change max limit number is bug prone.

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.

1 participant