summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/module.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/module.c b/src/module.c
index c29521670..7dee7e776 100644
--- a/src/module.c
+++ b/src/module.c
@@ -3866,7 +3866,10 @@ RedisModuleCtx *RM_GetThreadSafeContext(RedisModuleBlockedClient *bc) {
* in order to keep things like the currently selected database and similar
* things. */
ctx->client = createClient(-1);
- if (bc) selectDb(ctx->client,bc->dbid);
+ if (bc) {
+ selectDb(ctx->client,bc->dbid);
+ ctx->client->id = bc->client->id;
+ }
return ctx;
}