Skip to content

Instance Method

pttl(_:)

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

Parameters

key

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

Return Value

The number of milliseconds before the given key will expire.

Discussion

https://redis.io/commands/pttl