-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support remaining date based ChronoUnit enumerations for @Retry
annotation
#196
Comments
Would this work ?
|
Actually seems so! I assume this is because it doesn't use the |
We basically avoid any helper methods and just convert everything straight into the most common unit, nanoseconds. There might be some optimization that could be done where we compare everything MILLIS or below in nanos and everything else in seconds. Ultimately that just saves us an extra 9 digits in case the input values get crazy, but hopefully we don't have to be that resilient for now. |
We also have https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html#getNano--, but we may run into the same issue as before. |
As per #193 (comment):
We use
java.time.Duration
to calculate the difference between effective delay and max duration when passed as member values in the@Retry
annotation. According to the implementation ofDuration.plus
, any date basedChronoUnit
enumeration excludingDAYS
(e.g.WEEKS
,MONTHS
,YEARS
, etc..) will throw anUnsupportedTemporalTypeException
.Seeing that this is a limitation to the current implementation for
@Retry
diagnostics, (where we simply ignore these cases), there are 2 possible solutions:java.time.Duration
to support date based enumeration(s)The text was updated successfully, but these errors were encountered: