File tree Expand file tree Collapse file tree 1 file changed +9
-15
lines changed Expand file tree Collapse file tree 1 file changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -71,18 +71,6 @@ export function createBatchScheduler<
7171 const { resolve } = items [ i ]
7272 resolve ?.( [ data [ i ] , data ] )
7373 }
74-
75- if ( waitAsRateLimit ) {
76- if ( args . length === 0 ) {
77- flush ( )
78- return
79- }
80- setTimeout ( ( ) => {
81- clearBatchItems ( items . length )
82- exec ( )
83- } , wait )
84- return
85- }
8674 } )
8775 . catch ( ( err ) => {
8876 for ( let i = 0 ; i < items . length ; i ++ ) {
@@ -91,10 +79,16 @@ export function createBatchScheduler<
9179 }
9280 } )
9381
94- if ( ! waitAsRateLimit ) {
95- clearBatchItems ( items . length )
96- exec ( )
82+ if ( waitAsRateLimit ) {
83+ setTimeout ( ( ) => {
84+ clearBatchItems ( items . length )
85+ exec ( )
86+ } , wait )
87+ return
9788 }
89+
90+ clearBatchItems ( items . length )
91+ exec ( )
9892 }
9993
10094 const flush = ( ) => schedulerCache . delete ( id )
You can’t perform that action at this time.
0 commit comments