diff options
author | antirez <antirez@gmail.com> | 2019-10-23 10:41:55 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2019-10-23 10:41:55 +0200 |
commit | 3499e88de6ab1b95c4d3fbf1a3cbed288ad54711 (patch) | |
tree | 98f318849eaa4d481479b457a31950c31e2b4827 | |
parent | aead6eac8d79f85575c4240adce70258a072b35b (diff) | |
download | redis-3499e88de6ab1b95c4d3fbf1a3cbed288ad54711.tar.gz |
Modules hooks: select the right DB for FLUSHDB events.
-rw-r--r-- | src/module.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/module.c b/src/module.c index 21e98185a..0f57c9b14 100644 --- a/src/module.c +++ b/src/module.c @@ -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); |