emptyDbGeneric(): call signalFlushDb() before deleting the keys.

This was broken since a refactoring performed recently by myself.
This commit is contained in:
antirez 2019-07-30 11:20:51 +02:00
parent cc8125a779
commit e4b3c8bbc3

View File

@ -353,6 +353,11 @@ long long emptyDbGeneric(redisDb *dbarray, int dbnum, int flags, void(callback)(
return -1; 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; int startdb, enddb;
if (dbnum == -1) { if (dbnum == -1) {
startdb = 0; startdb = 0;
@ -378,7 +383,6 @@ long long emptyDbGeneric(redisDb *dbarray, int dbnum, int flags, void(callback)(
} }
} }
if (dbnum == -1) flushSlaveKeysWithExpireList(); if (dbnum == -1) flushSlaveKeysWithExpireList();
signalFlushedDb(dbnum);
return removed; return removed;
} }