We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e9c3b8 commit f7e6714Copy full SHA for f7e6714
1 file changed
src/utils/promise/createBatchScheduler.ts
@@ -71,18 +71,6 @@ export function createBatchScheduler<
71
const { resolve } = items[i]
72
resolve?.([data[i], data])
73
}
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
85
86
})
87
.catch((err) => {
88
for (let i = 0; i < items.length; i++) {
@@ -91,10 +79,16 @@ export function createBatchScheduler<
91
92
93
94
- if (!waitAsRateLimit) {
95
96
+ if (waitAsRateLimit) {
+ setTimeout(() => {
+ clearBatchItems(items.length)
+ exec()
+ }, wait)
+ return
97
89
+
90
98
99
100
const flush = () => schedulerCache.delete(id)
0 commit comments