Preserve client->id for blocked clients.

This commit is contained in:
Yossi Gottlieb 2019-05-05 20:32:53 +03:00
parent 0a6090bfd8
commit 9f3679880a

View File

@ -3866,7 +3866,10 @@ RedisModuleCtx *RM_GetThreadSafeContext(RedisModuleBlockedClient *bc) {
* in order to keep things like the currently selected database and similar * in order to keep things like the currently selected database and similar
* things. */ * things. */
ctx->client = createClient(-1); 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; return ctx;
} }