mirror of https://github.com/vuejs/core.git
fix(scheduler): improve error handling in job flushing (#13587)
This commit is contained in:
parent
25e075d967
commit
94b2ddc6f9
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue