try icon indicating copy to clipboard operation
try copied to clipboard

max retry limit fix

Open avisnakovs opened this issue 5 years ago • 0 comments

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.

avisnakovs avatar Sep 21 '18 08:09 avisnakovs