mirror of
https://github.com/fluencelabs/redis
synced 2025-03-17 16:10:50 +00:00
EXPIRE behaviour changed a bit, a negative TTL or an EXPIREAT with unix time in the past will now delete the key. It seems saner to me than doing nothing.
This commit is contained in:
parent
802e837373
commit
43e5ccdf57
5
redis.c
5
redis.c
@ -4746,8 +4746,9 @@ static void expireGenericCommand(redisClient *c, robj *key, time_t seconds) {
|
||||
addReply(c,shared.czero);
|
||||
return;
|
||||
}
|
||||
if (seconds <= 0) {
|
||||
addReply(c, shared.czero);
|
||||
if (seconds < 0) {
|
||||
if (deleteKey(c->db,key)) server.dirty++;
|
||||
addReply(c, shared.cone);
|
||||
return;
|
||||
} else {
|
||||
time_t when = time(NULL)+seconds;
|
||||
|
Loading…
x
Reference in New Issue
Block a user