]> git.saurik.com Git - redis.git/blobdiff - src/db.c
Change initialization to allow listening on both a port and socket
[redis.git] / src / db.c
index e1e82cb22fcd30540f97e2846b7bb020d6eb3531..958a9f6bc536937b3d31fdb86bf55b397df39cba 100644 (file)
--- a/src/db.c
+++ b/src/db.c
@@ -46,7 +46,6 @@ robj *lookupKeyRead(redisDb *db, robj *key) {
 
 robj *lookupKeyWrite(redisDb *db, robj *key) {
     deleteIfVolatile(db,key);
-    touchWatchedKey(db,key);
     return lookupKey(db,key);
 }
 
@@ -332,6 +331,7 @@ void renameGenericCommand(redisClient *c, int nx) {
         dbReplace(c->db,c->argv[2],o);
     }
     dbDelete(c->db,c->argv[1]);
+    touchWatchedKey(c->db,c->argv[1]);
     touchWatchedKey(c->db,c->argv[2]);
     server.dirty++;
     addReply(c,nx ? shared.cone : shared.ok);
@@ -472,11 +472,13 @@ void expireGenericCommand(redisClient *c, robj *key, robj *param, long offset) {
     if (seconds <= 0) {
         if (dbDelete(c->db,key)) server.dirty++;
         addReply(c, shared.cone);
+        touchWatchedKey(c->db,key);
         return;
     } else {
         time_t when = time(NULL)+seconds;
         if (setExpire(c->db,key,when)) {
             addReply(c,shared.cone);
+            touchWatchedKey(c->db,key);
             server.dirty++;
         } else {
             addReply(c,shared.czero);
@@ -504,5 +506,3 @@ void ttlCommand(redisClient *c) {
     }
     addReplySds(c,sdscatprintf(sdsempty(),":%d\r\n",ttl));
 }
-
-