return;
if (unit == UNIT_SECONDS) milliseconds *= 1000;
- milliseconds -= offset;
+ milliseconds += offset;
de = dictFind(c->db->dict,key->ptr);
if (de == NULL) {
addReply(c, shared.cone);
return;
} else {
- long long when = mstime()+milliseconds;
- setExpire(c->db,key,when);
+ setExpire(c->db,key,milliseconds);
addReply(c,shared.cone);
signalModifiedKey(c->db,key);
server.dirty++;
}
void expireCommand(redisClient *c) {
- expireGenericCommand(c,0,UNIT_SECONDS);
+ expireGenericCommand(c,mstime(),UNIT_SECONDS);
}
void expireatCommand(redisClient *c) {
- expireGenericCommand(c,mstime(),UNIT_SECONDS);
+ expireGenericCommand(c,0,UNIT_SECONDS);
}
void pexpireCommand(redisClient *c) {
- expireGenericCommand(c,0,UNIT_MILLISECONDS);
+ expireGenericCommand(c,mstime(),UNIT_MILLISECONDS);
}
void pexpireatCommand(redisClient *c) {
- expireGenericCommand(c,mstime(),UNIT_MILLISECONDS);
+ expireGenericCommand(c,0,UNIT_MILLISECONDS);
}
void ttlGenericCommand(redisClient *c, int output_ms) {