summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYossi Gottlieb <yossigo@gmail.com>2019-05-05 20:32:53 +0300
committerYossi Gottlieb <yossigo@gmail.com>2019-05-05 20:32:53 +0300
commit9f3679880a7cebc3ce73142e2e19ae3e1150f457 (patch)
treecc62cfba8c21999026e2c03dd94de91f6eec3b4d
parent0a6090bfd8fbec26f682ff0a1dc7a43699e0c9b7 (diff)
downloadredis-9f3679880a7cebc3ce73142e2e19ae3e1150f457.tar.gz
Preserve client->id for blocked clients.
-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;
}