Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Since you're doing a '...' it's hard to say for sure, but I'd say you're setting mykey during that part, which will effectively remove the expiration.</p> <p><a href="http://redis.io/commands/expire" rel="noreferrer">From the EXPIRE manual</a></p> <blockquote> <p>The timeout is cleared only when the key is removed using the DEL command or overwritten using the SET or GETSET commands</p> </blockquote> <p><a href="http://redis.io/commands/ttl" rel="noreferrer">Also, regarding the -1 reply from TTL</a></p> <blockquote> <p>Return value </p> <p>Integer reply: TTL in seconds or -1 when key does not exist or does not have a timeout.</p> </blockquote> <p><strong>EDIT: Note that this behaviour changed in Redis 2.8</strong></p> <blockquote> <p>Starting with Redis 2.8 the return value in case of error changed:<br> The command returns -2 if the key does not exist.<br> The command returns -1 if the key exists but has no associated expire.</p> </blockquote> <p>In other words, if your key exists, it would seem to be persistent, ie not have any expiration set.</p> <p>EDIT: It seems I can reproduce this if I create the key on a REDIS slave server, the slave will not delete the key without master input, since normally you would not create keys locally on a slave. Is this the case here?</p> <blockquote> <p>However while the slaves connected to a master will not expire keys independently (but will wait for the DEL coming from the master), they'll still take the full state of the expires existing in the dataset, so when a slave is elected to a master it will be able to expire the keys independently, fully acting as a master.</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload