Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Expiry time not accurate #169
It's possible that setting an expiry time on a key might take longer than one might expect to expire. Here's some code that proves the expiry time varies between runs:
A variation of ~10 milliseconds seems fair but this can be up to a second out. When you're working at a second granularity it's too far.
Hi, there is a branch implementing high res timers, the branch is called 'ttlres' and is pushed on github.
SETEX is still missing as a clear API for that is not clear.
The reason I did not used floats like EXPIRE foo 1.235 is because performances would suffer a lot from that in the parsing stage unfortunately. Also I think that to have the unit completely bind to the real max precision is a good idea.
Hi, ttlres branch merged. Now all the old commands have millisecond resolution, we also have three new commands:
The above command also allow to specify sub-second expires since now they are internally supported so it was a shame not exposing this capability in its full power. We'll add the new commands in the Redis.io documentation once 2.6 RC1 will be released.
Closing this issue.