* @internal
(
command: Command,
parser: CommandParser,
commandOptions: CommandOptions<TYPE_MAPPING> | undefined,
transformReply: TransformReply | undefined,
)
| 1220 | * @internal |
| 1221 | */ |
| 1222 | async _executeCommand( |
| 1223 | command: Command, |
| 1224 | parser: CommandParser, |
| 1225 | commandOptions: CommandOptions<TYPE_MAPPING> | undefined, |
| 1226 | transformReply: TransformReply | undefined, |
| 1227 | ) { |
| 1228 | const csc = this._self.#clientSideCache; |
| 1229 | const defaultTypeMapping = this._self.#options.commandOptions === commandOptions || |
| 1230 | (this._self.#options.commandOptions?.typeMapping === commandOptions?.typeMapping); |
| 1231 | |
| 1232 | const fn = () => { return this.sendCommand(parser.redisArgs, commandOptions) }; |
| 1233 | |
| 1234 | if (csc && command.CACHEABLE && defaultTypeMapping) { |
| 1235 | return await csc.handleCache(this._self, parser as BasicCommandParser, fn, transformReply, commandOptions?.typeMapping); |
| 1236 | } else { |
| 1237 | const reply = await fn(); |
| 1238 | |
| 1239 | const finalReply = transformReply ? transformReply(reply, parser.preserve, commandOptions?.typeMapping) : reply; |
| 1240 | |
| 1241 | publish(CHANNELS.COMMAND_REPLY, () => ({ args: sanitizeArgs(parser.redisArgs), reply: finalReply, clientId: this._self._clientId })); |
| 1242 | |
| 1243 | return finalReply; |
| 1244 | } |
| 1245 | } |
| 1246 | |
| 1247 | /** |
| 1248 | * @internal |
no test coverage detected