From: edison Date: Wed, 9 Jul 2025 00:44:24 +0000 (+0800) Subject: fix(scheduler): improve error handling in job flushing (#13587) X-Git-Tag: v3.6.0-alpha.1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94b2ddc6f97170f4169d9d81b963c6bcaab08be2;p=thirdparty%2Fvuejs%2Fcore.git fix(scheduler): improve error handling in job flushing (#13587) --- diff --git a/packages/runtime-core/src/scheduler.ts b/packages/runtime-core/src/scheduler.ts index a75eba300f..c5b1b23ff7 100644 --- a/packages/runtime-core/src/scheduler.ts +++ b/packages/runtime-core/src/scheduler.ts @@ -114,12 +114,18 @@ export function queueJob(job: SchedulerJob): void { } } +const doFlushJobs = () => { + try { + flushJobs() + } catch (e) { + currentFlushPromise = null + throw e + } +} + function queueFlush() { if (!currentFlushPromise) { - currentFlushPromise = resolvedPromise.then(flushJobs).catch(e => { - currentFlushPromise = null - throw e - }) + currentFlushPromise = resolvedPromise.then(doFlushJobs) } }