re-retrying
re-retrying copied to clipboard
For logging purposes, provide approximate delay until next retry
In a current project I have a RetryListener that provides debug output for each retry. I would really like for it to log when the next attempt will be made (if any). However, the Attempt does not contain that data.
A WaitStrategy, given the most recent failed Attempt, calculates the amount of time the Retryer should sleep before making another attempt. If the ResultAttempt and ExceptionAttempt took the WaitStrategy, the delay before the next retry could be calculated and saved as a field. Then the RetryListener could log that.