Is there any way to get the TTL (Time to Live) of a StackExchange.Redis key in c#?
I have little experience with redis but I believe you are referring to: (http://redis.io/commands/ttl).
If so, try running the .KeyTimeToLive("RedisKeyHere") on your database connection object.
See example:
class Program
{
static void Main(string[] args)
{
ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("localhost");
var db = redis.GetDatabase(0);
var timeToLive = db.KeyTimeToLive("RedisKeyNameHere");
}
}
I hope this information helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With