TTL doesn't seems to work?
Hi,
I have test the tool, and it is a great software! However, I not sure if the TTL effect any key under redis.
For example
curl -X PUT "http://localhost8101/mywebapp/create/username?ip=1.2.3.4&ttl=60"
provide the expected results:
{"token":"93wSlU3fsD3ndcLpBWXYBmMfN******************************************pd1"}
But when going to redis-cli I can see the key exist even after 60 sec.
Check the TTL of the key provide (integer) -1 which mean "The command returns -1 if the key exists but has no associated expire." see more here http://redis.io/commands/ttl
Is it a bug?
Expired sessions will be cleaned periodically (by default every 10 minutes. So a session with a 60s TTL will be alive for 60s after each request. E.g. that sessions TTL timer will be reset to 60 once you use it.
If it expires it will not automatically disappear from Redis but will be cleaned via a "housekeeping" routine that runs every 10 minutes.
@smrchy, thanks for that great software, I've found it very useful. Just curious about this issue, is the "housekeeping" routine included in this package? I couldn't find any references to it in the code.
Thanks!
Yes, if you don't change anything it will run every 10 minutes.