Skip to content

Conversation

@pixeltrix
Copy link
Contributor

In #28204 we deprecated implicit conversion of durations to a numeric which represented the number of seconds in the duration because of unwanted side effects with calculations on durations and dates. This unfortunately had the side effect of forcing a explicit cast when configuring third-party libraries like expiration in Redis, e.g:

redis.expire("foo", 5.minutes)

To work around this we've removed the deprecation and added a private class that wraps the numeric and can perform calculation involving durations and ensure that they remain a duration irrespective of the order of operations.

In #28204 we deprecated implicit conversion of durations to a
numeric which represented the number of seconds in the duration
because of unwanted side effects with calculations on durations
and dates. This unfortunately had the side effect of forcing a
explicit cast when configuring third-party libraries like
expiration in Redis, e.g:

    redis.expire("foo", 5.minutes)

To work around this we've removed the deprecation and added a
private class that wraps the numeric and can perform calculation
involving durations and ensure that they remain a duration
irrespective of the order of operations.
@pixeltrix pixeltrix force-pushed the remove-duration-deprecation branch from 99dedd8 to de5eb9e Compare March 15, 2017 14:58
@pixeltrix pixeltrix merged commit 8efbfba into master Mar 15, 2017
@pixeltrix pixeltrix deleted the remove-duration-deprecation branch March 15, 2017 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants