Modules hooks: select the right DB for FLUSHDB events.
This commit is contained in:
parent
bc1ef48e56
commit
89af7e4c85
@ -5872,6 +5872,9 @@ void moduleFireServerEvent(uint64_t eid, int subid, void *data) {
|
|||||||
moduledata = &civ1;
|
moduledata = &civ1;
|
||||||
} else if (eid == REDISMODULE_EVENT_FLUSHDB) {
|
} else if (eid == REDISMODULE_EVENT_FLUSHDB) {
|
||||||
moduledata = data;
|
moduledata = data;
|
||||||
|
RedisModuleFlushInfoV1 *fi = data;
|
||||||
|
if (fi->dbnum != -1)
|
||||||
|
selectDb(ctx.client, fi->dbnum);
|
||||||
}
|
}
|
||||||
el->callback(&ctx,el->event,subid,moduledata);
|
el->callback(&ctx,el->event,subid,moduledata);
|
||||||
moduleFreeContext(&ctx);
|
moduleFreeContext(&ctx);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user