chore: add ttl helper to Redis::Alfred

This commit is contained in:
Muhsin
2026-02-17 17:13:06 +05:30
parent d4e82e6c4c
commit 81afdf0703
+5
View File
@@ -40,6 +40,11 @@ module Redis::Alfred
$alfred.with { |conn| conn.expire(key, seconds) }
end
# get time to live for a key in seconds
def ttl(key)
$alfred.with { |conn| conn.ttl(key) }
end
# scan keys matching a pattern
def scan_each(match: nil, count: 100, &)
$alfred.with do |conn|