Skip to content

Commit

Permalink
fix(AsyncQueue): catch and log callback errors (jitsi#2370)
Browse files Browse the repository at this point in the history
  • Loading branch information
Auxane committed Oct 16, 2023
1 parent 510b646 commit a115161
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/util/AsyncQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ export default class AsyncQueue {
*/
clear() {
for (const finishedCallback of this._taskCallbacks.values()) {
try {
finishedCallback(new ClearedQueueError('The queue has been cleared'));
} catch (error) {
logger.error('Error in callback while clearing the queue:', error);
}
}
this._queue.kill();
}
Expand Down

0 comments on commit a115161

Please sign in to comment.