Skip to content

Commit

Permalink
fix #2318 - add MULTI (uppercase) (#2324)
Browse files Browse the repository at this point in the history
  • Loading branch information
leibale committed Nov 24, 2022
1 parent d923f71 commit 28b9701
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/client/lib/client/index.ts
Expand Up @@ -619,13 +619,15 @@ export default class RedisClient<
return this.#isolationPool.use(fn);
}

multi(): RedisClientMultiCommandType<M, F, S> {
MULTI(): RedisClientMultiCommandType<M, F, S> {
return new (this as any).Multi(
this.multiExecutor.bind(this),
this.#options?.legacyMode
);
}

multi = this.MULTI;

async multiExecutor(
commands: Array<RedisMultiQueuedCommand>,
selectedDB?: number,
Expand Down
4 changes: 3 additions & 1 deletion packages/client/lib/cluster/index.ts
Expand Up @@ -224,7 +224,7 @@ export default class RedisCluster<
}
}

multi(routing?: RedisCommandArgument): RedisClusterMultiCommandType<M, F, S> {
MULTI(routing?: RedisCommandArgument): RedisClusterMultiCommandType<M, F, S> {
return new this.#Multi(
(commands: Array<RedisMultiQueuedCommand>, firstKey?: RedisCommandArgument, chainId?: symbol) => {
return this.#execute(
Expand All @@ -237,6 +237,8 @@ export default class RedisCluster<
);
}

multi = this.MULTI;

getMasters(): Array<ClusterNode<M, F, S>> {
return this.#slots.getMasters();
}
Expand Down

0 comments on commit 28b9701

Please sign in to comment.