Skip to main content

Description

Remove the existing timeout on a key, turning the key from volatile (a key with an expire set) to persistent (a key that will never expire as no timeout is associated).

Method Signature

Parameters

key
string
required
The key to remove expiration from

Return Value

result
0 | 1
  • 1 if the timeout was removed
  • 0 if key does not exist or does not have an associated timeout

Examples

Remove expiration from a key

Key without expiration

Non-existent key

Make a temporary key permanent

See Also

  • expire - Set a key’s time to live
  • ttl - Get the time to live for a key