We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting TTL on objects (Hash, List, Set) seemingly converts seconds to milliseconds.
Use the below code snippet or the attached console app project: GarnetIssue2.zip
using StackExchange.Redis; using var redis = ConnectionMultiplexer.Connect("127.0.0.1:3278"); var db = redis.GetDatabase(); var key = "test:issue"; // KeyExpire on String - OK db.KeyDelete(key); db.StringSet(key, "a"); db.KeyExpire(key, TimeSpan.FromSeconds(10)); var ttlString = db.KeyTimeToLive(key); // KeyExpire on Hash - NOT OK db.KeyDelete(key); db.HashSet(key, "a", "b"); db.KeyExpire(key, TimeSpan.FromSeconds(10)); var ttlHash = db.KeyTimeToLive(key); // Results: Console.WriteLine($"TTL String : {ttlString}"); Console.WriteLine($"TTL Hash : {ttlHash}");
Output:
TTL String : 00:00:09.9980000 TTL Hash : 00:00:00.0090000
Result TTL should be approximately the same for String and Hash, about 10 seconds.
Actual results: ~10 seconds for String and ~9 milliseconds for Hash.
Tested List and Set types also show the issue.
The text was updated successfully, but these errors were encountered:
Fix TTL on objects, issue #337 (#338)
023f1fe
Use `GarnetObjectType.PTtl` or `GarnetObjectType.Ttl` depending on the flag `milliseconds`.
Successfully merging a pull request may close this issue.
Describe the bug
Getting TTL on objects (Hash, List, Set) seemingly converts seconds to milliseconds.
Steps to reproduce the bug
Use the below code snippet or the attached console app project:
GarnetIssue2.zip
Output:
Expected behavior
Result TTL should be approximately the same for String and Hash, about 10 seconds.
Actual results: ~10 seconds for String and ~9 milliseconds for Hash.
Tested List and Set types also show the issue.
Additional context
The text was updated successfully, but these errors were encountered: