summaryrefslogtreecommitdiff
path: root/src/db.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2019-07-30 11:20:51 +0200
committerantirez <antirez@gmail.com>2019-07-30 11:20:54 +0200
commite4b3c8bbc3d01176dee434a6ae8e8e10bb74703a (patch)
tree2e2d078de3618ed25623c2d8a1763bd80909304d /src/db.c
parentcc8125a779ad534571bac5904350cf409f09c467 (diff)
downloadredis-e4b3c8bbc3d01176dee434a6ae8e8e10bb74703a.tar.gz
emptyDbGeneric(): call signalFlushDb() before deleting the keys.
This was broken since a refactoring performed recently by myself.
Diffstat (limited to 'src/db.c')
-rw-r--r--src/db.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/db.c b/src/db.c
index 3d8b844e8..95eaf04e9 100644
--- a/src/db.c
+++ b/src/db.c
@@ -353,6 +353,11 @@ long long emptyDbGeneric(redisDb *dbarray, int dbnum, int flags, void(callback)(
return -1;
}
+ /* Make sure the WATCHed keys are affected by the FLUSH* commands.
+ * Note that we need to call the function while the keys are still
+ * there. */
+ signalFlushedDb(dbnum);
+
int startdb, enddb;
if (dbnum == -1) {
startdb = 0;
@@ -378,7 +383,6 @@ long long emptyDbGeneric(redisDb *dbarray, int dbnum, int flags, void(callback)(
}
}
if (dbnum == -1) flushSlaveKeysWithExpireList();
- signalFlushedDb(dbnum);
return removed;
}