Skip to content

Commit

Permalink
chore: Formatted code using prettier.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShogunPanda authored and AVVS committed Oct 23, 2020
1 parent d6e78c3 commit 279f67e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
9 changes: 6 additions & 3 deletions lib/autoPipelining.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
});
});
}

Expand Down
2 changes: 1 addition & 1 deletion lib/cluster/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ class Cluster extends EventEmitter {
for (const c of this._readyDelayedCallbacks) {
process.nextTick(c, err);
}

this._readyDelayedCallbacks = [];
}

Expand Down
4 changes: 2 additions & 2 deletions lib/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down

0 comments on commit 279f67e

Please sign in to comment.