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
Issue tracker is used for reporting bugs and discussing new features. Please use stackoverflow for supporting issues.
Expected Behavior
That retrieving a TTL for a key should return a positive value.
Current Behavior
When retrieving a TTL for key with a long duration, time.Duration overflows. For example, set a key in Redis with a TTL of 116637714045176. This library effectively executes the following:
The result will be -291314h41m29.494867968s which is no where near correct as it should be 32399365012.54889 hours.
This was discovered when writing a background scan job with this library to remove TTLs that were set incorrectly previously. Because of the overflow, these longer TTL values are not represented correctly but valid in Redis.
Possible Solution
The use of time.Duration should likely be replaced with int64 instead to properly match up with Redis as the time.Duration time is in nanoseconds.
The text was updated successfully, but these errors were encountered:
Issue tracker is used for reporting bugs and discussing new features. Please use
stackoverflow for supporting issues.
Expected Behavior
That retrieving a TTL for a key should return a positive value.
Current Behavior
When retrieving a TTL for key with a long duration, time.Duration overflows. For example, set a key in Redis with a TTL of
116637714045176
. This library effectively executes the following:The result will be
-291314h41m29.494867968s
which is no where near correct as it should be32399365012.54889 hours
.This was discovered when writing a background scan job with this library to remove TTLs that were set incorrectly previously. Because of the overflow, these longer TTL values are not represented correctly but valid in Redis.
Possible Solution
The use of time.Duration should likely be replaced with int64 instead to properly match up with Redis as the time.Duration time is in nanoseconds.
The text was updated successfully, but these errors were encountered: