socket-function 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/batching.ts +6 -1
package/package.json
CHANGED
package/src/batching.ts
CHANGED
|
@@ -149,7 +149,12 @@ export function batchFunction<Arg, Result = void>(
|
|
|
149
149
|
let curPrevPromise = prevPromise;
|
|
150
150
|
let args: Arg[] = [arg];
|
|
151
151
|
let promise = Promise.resolve().then(async () => {
|
|
152
|
-
|
|
152
|
+
// Ignore the error. New callers don't care about errors in previous calls,
|
|
153
|
+
// as they are unrelated to the current call, and just break valid calls
|
|
154
|
+
// due to invalid calls.
|
|
155
|
+
try {
|
|
156
|
+
await curPrevPromise;
|
|
157
|
+
} catch { }
|
|
153
158
|
await delay(curDelay, "immediateShortDelays");
|
|
154
159
|
// Reset batching, as we once we start the function we can't accept args. `prevPromise` will block
|
|
155
160
|
// the next batch from starting before we finish.
|