mirror of
https://github.com/koush/scrypted.git
synced 2026-02-03 14:13:28 +00:00
common: fix waiting dequeues on queue end
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user