You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
buffers, buffers everywhere...
This commit is contained in:
@@ -76,8 +76,7 @@ export default class RedisCluster<M extends RedisModules = Record<string, never>
|
||||
RedisCluster.extractFirstKey(command, args, redisArgs),
|
||||
command.IS_READ_ONLY,
|
||||
redisArgs,
|
||||
options,
|
||||
command.BUFFER_MODE
|
||||
options
|
||||
),
|
||||
redisArgs.preserve
|
||||
);
|
||||
@@ -88,19 +87,18 @@ export default class RedisCluster<M extends RedisModules = Record<string, never>
|
||||
isReadonly: boolean | undefined,
|
||||
args: RedisCommandArguments,
|
||||
options?: ClientCommandOptions,
|
||||
bufferMode?: boolean,
|
||||
redirections = 0
|
||||
): Promise<RedisCommandReply<C>> {
|
||||
const client = this.#slots.getClient(firstKey, isReadonly);
|
||||
|
||||
try {
|
||||
return await client.sendCommand(args, options, bufferMode);
|
||||
return await client.sendCommand(args, options);
|
||||
} catch (err: any) {
|
||||
const shouldRetry = await this.#handleCommandError(err, client, redirections);
|
||||
if (shouldRetry === true) {
|
||||
return this.sendCommand(firstKey, isReadonly, args, options, bufferMode, redirections + 1);
|
||||
return this.sendCommand(firstKey, isReadonly, args, options, redirections + 1);
|
||||
} else if (shouldRetry) {
|
||||
return shouldRetry.sendCommand(args, options, bufferMode);
|
||||
return shouldRetry.sendCommand(args, options);
|
||||
}
|
||||
|
||||
throw err;
|
||||
@@ -135,13 +133,13 @@ export default class RedisCluster<M extends RedisModules = Record<string, never>
|
||||
);
|
||||
|
||||
try {
|
||||
return await client.executeScript(script, redisArgs, options, script.BUFFER_MODE);
|
||||
return await client.executeScript(script, redisArgs, options);
|
||||
} catch (err: any) {
|
||||
const shouldRetry = await this.#handleCommandError(err, client, redirections);
|
||||
if (shouldRetry === true) {
|
||||
return this.executeScript(script, originalArgs, redisArgs, options, redirections + 1);
|
||||
} else if (shouldRetry) {
|
||||
return shouldRetry.executeScript(script, redisArgs, options, script.BUFFER_MODE);
|
||||
return shouldRetry.executeScript(script, redisArgs, options);
|
||||
}
|
||||
|
||||
throw err;
|
||||
|
Reference in New Issue
Block a user