From 279f67eb18e6c20dc7d461fe6890ac22f63cd0fa Mon Sep 17 00:00:00 2001 From: Paolo Insogna Date: Fri, 16 Oct 2020 15:27:35 +0200 Subject: [PATCH] chore: Formatted code using prettier. --- lib/autoPipelining.ts | 9 ++++++--- lib/cluster/index.ts | 2 +- lib/pipeline.ts | 4 ++-- lib/transaction.ts | 4 ++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/autoPipelining.ts b/lib/autoPipelining.ts index 45e7b64f..4d721f1d 100644 --- a/lib/autoPipelining.ts +++ b/lib/autoPipelining.ts @@ -88,14 +88,17 @@ export function executeWithAutoPipelining( // On cluster mode let's wait for slots to be available if (client.isCluster && !client.slots.length) { return new CustomPromise(function (resolve, reject) { - client.delayUntilReady(err => { + client.delayUntilReady((err) => { if (err) { reject(err); return; } - executeWithAutoPipelining(client, commandName, args, callback).then(resolve, reject); - }) + executeWithAutoPipelining(client, commandName, args, callback).then( + resolve, + reject + ); + }); }); } diff --git a/lib/cluster/index.ts b/lib/cluster/index.ts index 6796b714..f7b3b4d2 100644 --- a/lib/cluster/index.ts +++ b/lib/cluster/index.ts @@ -848,7 +848,7 @@ class Cluster extends EventEmitter { for (const c of this._readyDelayedCallbacks) { process.nextTick(c, err); } - + this._readyDelayedCallbacks = []; } diff --git a/lib/pipeline.ts b/lib/pipeline.ts index 194ee5a4..44ac4a06 100644 --- a/lib/pipeline.ts +++ b/lib/pipeline.ts @@ -236,14 +236,14 @@ Pipeline.prototype.execBuffer = deprecate(function () { Pipeline.prototype.exec = function (callback: CallbackFunction) { // Wait for the cluster to be connected, since we need nodes information before continuing if (this.isCluster && !this.redis.slots.length) { - this.redis.delayUntilReady(err => { + this.redis.delayUntilReady((err) => { if (err) { callback(err); return; } this.exec(callback); - }) + }); return this.promise; } diff --git a/lib/transaction.ts b/lib/transaction.ts index 41583cfc..a0c11901 100644 --- a/lib/transaction.ts +++ b/lib/transaction.ts @@ -32,14 +32,14 @@ export function addTransactionSupport(redis) { if (this.isCluster && !this.redis.slots.length) { return asCallback( new Promise((resolve, reject) => { - this.redis.delayUntilReady(err => { + this.redis.delayUntilReady((err) => { if (err) { reject(err); return; } this.exec(pipeline).then(resolve, reject); - }) + }); }), callback );