mirror of
https://github.com/fluencelabs/redis
synced 2025-04-02 15:51:05 +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);
|
addReply(c,shared.czero);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (seconds <= 0) {
|
if (seconds < 0) {
|
||||||
addReply(c, shared.czero);
|
if (deleteKey(c->db,key)) server.dirty++;
|
||||||
|
addReply(c, shared.cone);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
time_t when = time(NULL)+seconds;
|
time_t when = time(NULL)+seconds;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user