Closed jamesgecko closed 10 months ago
That's not correct. There is no such thing as TTL values, here you are passing an ActiveSupport::Duration
instance. And there is no special handling about them.
Sorry, I was trying to copy the language from the changelog, but maybe there's a better way to state it.
The Integer casting added to various duration-related functions in 5.0.4 does operate on ActiveRecord::Duration
because of duck typing; the cast returns the duration in seconds as an integer. I can change the example if you'd prefer something less Rails-y?
Yes. But also note you are linking to the redis
gem, which define a speciific method for each command, so it know what the expected type is, so it can cast to integer where an integer is expected.
Here we're commenting in redis-client
, which is lower level and doesn't know anything about command signatures and what the expected types are, hence why it only as very simplistic and generic casting rules.
The changelog mentions that TTL values are cast to int, but this information is not present in the types section of the README. Adding the info with an example.