X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/abe18d0e00f8ef15aac18ce59c17f90627b72e9e..532e0f5ded866881d46f0aeac3756ebd3a3da98e:/doc/ExpireCommand.html diff --git a/doc/ExpireCommand.html b/doc/ExpireCommand.html index cebac8b8..736d951a 100644 --- a/doc/ExpireCommand.html +++ b/doc/ExpireCommand.html @@ -16,7 +16,7 @@
Set a timeout on the specified key. After the timeout the key will beautomatically delete by the server. A key with an associated timeout issaid to be volatile in Redis terminology.+
Set a timeout on the specified key. After the timeout the key will beautomatically deleted by the server. A key with an associated timeout issaid to be volatile in Redis terminology.
Voltile keys are stored on disk like the other keys, the timeout is persistenttoo like all the other aspects of the dataset. Saving a dataset containingexpires and stopping the server does not stop the flow of time as Redisstores on disk the time when the key will no longer be available as Unixtime, and not the remaining seconds.
EXPIREAT works exctly like EXPIRE but instead to get the number of secondsrepresenting the Time To Live of the key as a second argument (that is arelative way of specifing the TTL), it takes an absolute one in the form ofa UNIX timestamp (Number of seconds elapsed since 1 Gen 1970).
EXPIREAT was introduced in order to implement the Append Only File persistence modeso that EXPIRE commands are automatically translated into EXPIREAT commands for the append only file. Of course EXPIREAT can alsoused by programmers that need a way to simply specify that a given key should expire at a given time in the future.@@ -78,7 +78,7 @@ redis> incr a (integer) 1 I set a key to the value of 100, then set an expire of 360 seconds, and then incremented the key (before the 360 timeout expired of course). The obvious result would be: 101, instead the key is set to the value of 1. Why? -There is a very important reason involving the Append Only File and Replication. Let's rework a bit hour example adding the notion of time to the mix: +There is a very important reason involving the Append Only File and Replication. Let's rework a bit our example adding the notion of time to the mix:
SET a 100 EXPIRE a 5 @@ -87,7 +87,6 @@ INCR aImagine a Redis version that does not implement the "Delete keys with an expire set on write operation" semantic. Running the above example with the 10 seconds pause will lead to 'a' being set to the value of 1, as it no longer exists when INCR is called 10 seconds later.