summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYossi Gottlieb <yossigo@gmail.com>2019-05-05 20:32:53 +0300
committerantirez <antirez@gmail.com>2019-05-10 18:09:42 +0200
commite08c9c154bd106e39bb57b8a70a8ddf031b15a22 (patch)
tree507323a2b8d2db4a8d06d7562479cfe89121803a
parentc6b1252f1dec8d0a91accc595a85fcb56ad9233b (diff)
downloadredis-e08c9c154bd106e39bb57b8a70a8ddf031b15a22.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 41611215f..ac868611d 100644
--- a/src/module.c
+++ b/src/module.c
@@ -3824,7 +3824,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;
}