Arguments

key
str
required

The key to set the timeout on.

seconds
int | datetime.timedelta
required

The timeout in seconds as int or datetime.timedelta object

nx
bool

Set expiry only when the key has no expiry

xx
bool

Set expiry only when the key has an existing expiry

gt
bool

Set expiry only when the new expiry is greater than current one

lt
bool

Set expiry only when the new expiry is less than current one

Response

True if the timeout was set