Skip to content

Commit

Permalink
fix: remove unused Command#isCustomCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed Mar 14, 2022
1 parent 7b98355 commit 46ade6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
1 change: 0 additions & 1 deletion lib/Command.ts
Expand Up @@ -140,7 +140,6 @@ export default class Command implements Respondable {
isReadOnly?: boolean;

args: CommandParameter[];
isCustomCommand = false;
inTransaction = false;
pipelineIndex?: number;

Expand Down
14 changes: 2 additions & 12 deletions lib/Script.ts
Expand Up @@ -17,8 +17,6 @@ export default class Script {
const sha = this.sha;
const socketHasScriptLoaded = new WeakSet();
this.Command = class CustomScriptCommand extends Command {
isCustomCommand = true;

toWritable(socket: object): string | Buffer {
const origReject = this.reject;
this.reject = (err) => {
Expand Down Expand Up @@ -52,11 +50,7 @@ export default class Script {
options.readOnly = true;
}

const evalsha = new this.Command(
"evalsha",
[this.sha, ...args],
options
);
const evalsha = new this.Command("evalsha", [this.sha, ...args], options);

evalsha.promise = evalsha.promise.catch((err: Error) => {
if (err.message.indexOf("NOSCRIPT") === -1) {
Expand All @@ -65,11 +59,7 @@ export default class Script {

// Resend the same custom evalsha command that gets transformed
// to an eval in case it's not loaded yet on the connection.
const resend = new this.Command(
"evalsha",
[this.sha, ...args],
options
);
const resend = new this.Command("evalsha", [this.sha, ...args], options);

const client = container.isPipeline ? container.redis : container;
return client.sendCommand(resend);
Expand Down

0 comments on commit 46ade6b

Please sign in to comment.