Method: Redis#pttl

Defined in:
lib/redis.rb

#pttl(key) ⇒ Fixnum

Get the time to live (in milliseconds) for a key.

Parameters:

  • key (String)

Returns:

  • (Fixnum)

    remaining time to live in milliseconds, or -1 if the key does not exist or does not have a timeout



362
363
364
365
366
# File 'lib/redis.rb', line 362

def pttl(key)
  synchronize do |client|
    client.call([:pttl, key])
  end
end