diff --git a/packages/runtime-core/src/scheduler.ts b/packages/runtime-core/src/scheduler.ts index a75eba300f7..c5b1b23ff7c 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) } }