Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
leibale committed Oct 19, 2021
1 parent ae264ff commit e3ebda1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,8 @@ export default class RedisClient<M extends RedisModules, S extends RedisScripts>

if (promises.length) {
this.#tick();
await Promise.all(promises);
}

await Promise.all(promises);
};

return new RedisSocket(socketInitiator, this.#options?.socket)
Expand Down Expand Up @@ -318,9 +317,9 @@ export default class RedisClient<M extends RedisModules, S extends RedisScripts>
}

// using `#sendCommand` cause `sendCommand` is overwritten in legacy mode
async #sendCommand<T = RedisCommandRawReply>(args: RedisCommandArguments, options?: ClientCommandOptions, bufferMode?: boolean): Promise<T> {
#sendCommand<T = RedisCommandRawReply>(args: RedisCommandArguments, options?: ClientCommandOptions, bufferMode?: boolean): Promise<T> {
if (!this.#socket.isOpen) {
throw new ClientClosedError();
return Promise.reject(new ClientClosedError());
}

if (options?.isolated) {
Expand All @@ -334,7 +333,7 @@ export default class RedisClient<M extends RedisModules, S extends RedisScripts>

const promise = this.#queue.addCommand<T>(args, options, bufferMode);
this.#tick();
return await promise;
return promise;
}

async scriptsExecutor(script: RedisScript, args: Array<unknown>): Promise<RedisCommandReply<typeof script>> {
Expand Down

0 comments on commit e3ebda1

Please sign in to comment.