Check key expiration before deleting

Deleting an expired key should return 0, not success.

Fixes #1648
This commit is contained in:
Matt Stancliff 2014-04-10 17:08:02 -04:00
parent 67bb2c46b2
commit 83d2830372

View File

@ -280,6 +280,7 @@ void delCommand(redisClient *c) {
int deleted = 0, j;
for (j = 1; j < c->argc; j++) {
expireIfNeeded(c->db,c->argv[j]);
if (dbDelete(c->db,c->argv[j])) {
signalModifiedKey(c->db,c->argv[j]);
notifyKeyspaceEvent(REDIS_NOTIFY_GENERIC,