File tree Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change @@ -56,18 +56,6 @@ export function makePromiseBuffer<T>(limit: number = 100): PromiseBuffer<T> {
5656 return task ;
5757 }
5858
59- function _drainNextSyncPromise ( ) : PromiseLike < boolean > {
60- const item = buffer . values ( ) . next ( ) . value as PromiseLike < T > ;
61-
62- if ( ! item ) {
63- return resolvedSyncPromise ( true ) ;
64- }
65-
66- return item . then ( ( ) => {
67- return _drainNextSyncPromise ( ) ;
68- } ) ;
69- }
70-
7159 /**
7260 * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first.
7361 *
@@ -82,7 +70,7 @@ export function makePromiseBuffer<T>(limit: number = 100): PromiseBuffer<T> {
8270 return resolvedSyncPromise ( true ) ;
8371 }
8472
85- const drainPromise = _drainNextSyncPromise ( ) ;
73+ const drainPromise = Promise . all ( Array . from ( buffer ) ) . then ( ( ) => true ) ;
8674
8775 if ( ! timeout ) {
8876 return drainPromise ;
You can’t perform that action at this time.
0 commit comments