From e4b3c8bbc3d01176dee434a6ae8e8e10bb74703a Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 30 Jul 2019 11:20:51 +0200 Subject: emptyDbGeneric(): call signalFlushDb() before deleting the keys. This was broken since a refactoring performed recently by myself. --- src/db.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/db.c') 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; } -- cgit v1.2.1