Skip to content

Commit

Permalink
common: fix waiting dequeues on queue end
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Nov 18, 2023
1 parent eab0746 commit dd4efcd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion common/src/async-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ export function createAsyncQueue<T>() {
return false;
// catch to prevent unhandled rejection.
ended = e || new EndError()
clear(e);
clear(ended);
while (waiting.length) {
waiting.shift().reject(ended);
}
return true;
}

Expand Down

0 comments on commit dd4efcd

Please sign in to comment.