mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 10:12:00 +08:00
[local-sync] Don't run interrupts within the sync-worker serially
Run them at the same time instead, using Promise.all()
This commit is contained in:
parent
fa6aec3cee
commit
450f6fde13
1 changed files with 3 additions and 2 deletions
|
@ -432,10 +432,11 @@ class SyncWorker {
|
|||
|
||||
async interrupt({reason = 'No reason'} = {}) {
|
||||
console.log(`🔃 Interrupting sync! Reason: ${reason}`)
|
||||
await this._interruptible.interrupt()
|
||||
const interruptPromises = [await this._interruptible.interrupt()]
|
||||
if (this._currentTask) {
|
||||
await this._currentTask.interrupt()
|
||||
interruptPromises.push(this._currentTask.interrupt())
|
||||
}
|
||||
await Promise.all(interruptPromises)
|
||||
this._interrupted = true
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue