Skip to content

Conversation

@avisnakovs
Copy link

@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