[client-sync] Wrap more syncWorker args

Turns out the SyncWorker isn't the only one who initiates SyncTasks
This commit is contained in:
Halla Moore 2017-03-31 11:12:50 -07:00
parent ae2e2122e9
commit af6e6e669a
4 changed files with 5 additions and 5 deletions

View file

@ -52,7 +52,7 @@ async function* saveSentMessage({db, account, syncWorker, logger, imap, provider
account,
folder: sentFolder,
})
yield syncOperation.run(db, imap, syncWorker)
yield syncOperation.run(db, imap, {syncWorker})
return
}
@ -91,7 +91,7 @@ async function* saveSentMessage({db, account, syncWorker, logger, imap, provider
account,
folder: allMailFolder,
})
yield syncOperation.run(db, imap, syncWorker)
yield syncOperation.run(db, imap, {syncWorker})
}
async function* setThreadingReferences(db, baseMessage) {

View file

@ -55,7 +55,7 @@ class MoveThreadToFolderIMAP extends SyncbackIMAPTask {
account: this._account,
folder: targetFolder,
})
yield syncOperation.run(db, imap, syncWorker)
yield syncOperation.run(db, imap, {syncWorker})
}
}
module.exports = MoveThreadToFolderIMAP

View file

@ -60,7 +60,7 @@ class SetThreadFolderAndLabelsIMAP extends SyncbackIMAPTask {
account: this._account,
folder: targetFolder,
})
yield syncOperation.run(db, imap, syncWorker)
yield syncOperation.run(db, imap, {syncWorker})
}
}
module.exports = SetThreadFolderAndLabelsIMAP

View file

@ -47,7 +47,7 @@ class SyncUnknownUIDs extends SyncbackIMAPTask {
uids: uidsToSync,
});
this._syncOperation.on('message-processed', () => this.onMessageProcessed());
yield this._syncOperation.run(db, imap, syncWorker)
yield this._syncOperation.run(db, imap, {syncWorker})
this._syncOperation.removeAllListeners('message-processed');
if (yield this._isCancelled()) {