summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2019-12-13 17:34:37 +0100
committerantirez <antirez@gmail.com>2019-12-13 17:34:37 +0100
commit096592506ef3f548a4a3484d5829e04749a24a99 (patch)
treead0292ffaac955396940761044a39e8b19d0050d
parentd7a87d0ea46bcac6f55e3df3e7525a488e4c0694 (diff)
downloadredis-096592506ef3f548a4a3484d5829e04749a24a99.tar.gz
Modules: allow to execute RM_Call() from the module init function.
-rw-r--r--src/module.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/module.c b/src/module.c
index 8acafccfe..a96691182 100644
--- a/src/module.c
+++ b/src/module.c
@@ -6985,6 +6985,8 @@ int moduleLoad(const char *path, void **module_argv, int module_argc) {
int (*onload)(void *, void **, int);
void *handle;
RedisModuleCtx ctx = REDISMODULE_CTX_INIT;
+ ctx.client = moduleFreeContextReusedClient;
+ selectDb(ctx.client, 0);
struct stat st;
if (stat(path, &st) == 0)