Skip to content

Commit f150e86

Browse files
committed
wip
1 parent 9c1f2a0 commit f150e86

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2544
-1852
lines changed

packages/client/lib/client/commands-queue.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,10 @@ export default class RedisCommandsQueue {
285285
}
286286

287287
private _flushWaitingForReply(err: Error): void {
288-
while (this._waitingForReply.head) {
289-
this._waitingForReply.shift()!.reject(err);
288+
for (const node of this._waitingForReply) {
289+
node.reject(err);
290290
}
291+
this._waitingForReply.reset();
291292
}
292293

293294
private static _removeAbortListener(command: CommandWaitingToBeSent) {
@@ -324,12 +325,10 @@ export default class RedisCommandsQueue {
324325
this.decoder.reset();
325326
this._pubSub.reset();
326327
this._flushWaitingForReply(err);
327-
while (this._waitingToBeSent.head) {
328-
RedisCommandsQueue._flushWaitingToBeSent(
329-
this._waitingToBeSent.shift()!,
330-
err
331-
);
328+
for (const node of this._waitingToBeSent) {
329+
RedisCommandsQueue._flushWaitingToBeSent(node, err);
332330
}
331+
this._waitingToBeSent.reset();
333332
}
334333

335334
isEmpty() {

0 commit comments

Comments
 (0)