Fix syncback request object

This commit is contained in:
Evan Morikawa 2016-06-29 10:11:53 -07:00
parent 8a53dca755
commit cf87325c5d
2 changed files with 9 additions and 4 deletions

View file

@ -131,12 +131,13 @@ class SyncWorker {
}
runSyncbackTask(task) {
const syncbackRequest = task.syncbackRequestObject()
return this._conn.runOperation(task)
.then(() => { task.syncbackRequest.status = "SUCCEEDED" })
.then(() => { syncbackRequest.status = "SUCCEEDED" })
.catch((error) => {
task.syncbackRequest.error = error
task.syncbackRequest.status = "FAILED"
}).finally(() => task.syncbackRequest.save())
syncbackRequest.error = error
syncbackRequest.status = "FAILED"
}).finally(() => syncbackRequest.save())
}
syncAllCategories() {

View file

@ -4,6 +4,10 @@ class MoveToFolderIMAP {
this._syncbackRequest = syncbackRequest;
}
syncbackRequestObject() {
return this._syncbackRequest;
}
description() {
return `MoveToFolder`;
}