1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

fix #2318 - add MULTI (uppercase) (#2324)

This commit is contained in:
Leibale Eidelman
2022-11-24 14:01:43 -05:00
committed by GitHub
parent d923f7127a
commit 28b9701543
2 changed files with 6 additions and 2 deletions

View File

@@ -619,13 +619,15 @@ export default class RedisClient<
return this.#isolationPool.use(fn); return this.#isolationPool.use(fn);
} }
multi(): RedisClientMultiCommandType<M, F, S> { MULTI(): RedisClientMultiCommandType<M, F, S> {
return new (this as any).Multi( return new (this as any).Multi(
this.multiExecutor.bind(this), this.multiExecutor.bind(this),
this.#options?.legacyMode this.#options?.legacyMode
); );
} }
multi = this.MULTI;
async multiExecutor( async multiExecutor(
commands: Array<RedisMultiQueuedCommand>, commands: Array<RedisMultiQueuedCommand>,
selectedDB?: number, selectedDB?: number,

View File

@@ -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( return new this.#Multi(
(commands: Array<RedisMultiQueuedCommand>, firstKey?: RedisCommandArgument, chainId?: symbol) => { (commands: Array<RedisMultiQueuedCommand>, firstKey?: RedisCommandArgument, chainId?: symbol) => {
return this.#execute( return this.#execute(
@@ -237,6 +237,8 @@ export default class RedisCluster<
); );
} }
multi = this.MULTI;
getMasters(): Array<ClusterNode<M, F, S>> { getMasters(): Array<ClusterNode<M, F, S>> {
return this.#slots.getMasters(); return this.#slots.getMasters();
} }