You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While this is a good default, it's still very specific and cannot be assumed to be the desired behavior in all cases. For instance, when there is no internet, statusCode would be undefined, but this is hardcoded to not retry, In our case we would like to override this behavior to retry when there is no internet. In the general case, this behavior should be configurable.
The solution I'd like
The ability to specify which status codes should result in a retry. Something like:
(Though clearly the number of arguments to this function is getting out of control, so a better solution might be desirable.)
The alternatives I've considered
To work around this, we copy-pasted the entire retry policy into our user code to change this one small piece.
The text was updated successfully, but these errors were encountered:
mikechamberlain
changed the title
Allow custom shouldRetry logic in exponentialRetryPolicy
Allow customization of status codes to retry in exponentialRetryPolicy
Mar 15, 2019
Describe the problem
In
exponentialRetryPolicy
, the status codes to retry are hard coded in theshouldRetry
functionas follows:While this is a good default, it's still very specific and cannot be assumed to be the desired behavior in all cases. For instance, when there is no internet,
statusCode
would beundefined
, but this is hardcoded to not retry, In our case we would like to override this behavior to retry when there is no internet. In the general case, this behavior should be configurable.The solution I'd like
The ability to specify which status codes should result in a retry. Something like:
(Though clearly the number of arguments to this function is getting out of control, so a better solution might be desirable.)
The alternatives I've considered
To work around this, we copy-pasted the entire retry policy into our user code to change this one small piece.
The text was updated successfully, but these errors were encountered: