Skip to content

Instance Method

ttl(_:)

Returns the remaining time-to-live (in seconds) of the provided key.
func ttl(_ key: RedisKey) async throws -> RedisKey.Lifetime

Parameters

key

The key to check the time-to-live on.

Return Value

The number of seconds before the given key will expire.

Discussion

https://redis.io/commands/ttl