提交 43e5ccdf 编写于 作者: A antirez

EXPIRE behaviour changed a bit, a negative TTL or an EXPIREAT with unix time...

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.
上级 802e8373
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册