Modules hooks: select the right DB for FLUSHDB events.

This commit is contained in:
antirez 2019-10-23 10:41:55 +02:00
parent bc1ef48e56
commit 89af7e4c85

View File

@ -5872,6 +5872,9 @@ void moduleFireServerEvent(uint64_t eid, int subid, void *data) {
moduledata = &civ1;
} else if (eid == REDISMODULE_EVENT_FLUSHDB) {
moduledata = data;
RedisModuleFlushInfoV1 *fi = data;
if (fi->dbnum != -1)
selectDb(ctx.client, fi->dbnum);
}
el->callback(&ctx,el->event,subid,moduledata);
moduleFreeContext(&ctx);