[local-sync] Save error when clearing tasks INPROGRESS

This commit is contained in:
Juan Tejada 2017-01-31 15:59:49 -08:00
parent 83744c73d0
commit 4769d4d476
2 changed files with 2 additions and 1 deletions

View file

@ -25,7 +25,7 @@ class FetchNewMessagesInFolderIMAP extends FetchMessagesInFolderIMAP {
// operation // operation
// Can't use `super` in this scenario because babel can't compile it under // Can't use `super` in this scenario because babel can't compile it under
// these conditions. User regular prototype instead // these conditions. User regular prototype instead
console.log(`🔚 📂 🆕$ {this._folder.name} has no fetchedmax - running regular fetch operation`) console.log(`🔚 📂 🆕 ${this._folder.name} has no fetchedmax - running regular fetch operation`)
yield FetchMessagesInFolderIMAP.prototype.runTask.call(this, db, imap) yield FetchMessagesInFolderIMAP.prototype.runTask.call(this, db, imap)
return return
} }

View file

@ -105,6 +105,7 @@ export async function markInProgressTasksAsFailed({db} = {}) {
for (const inProgress of inProgressTasks) { for (const inProgress of inProgressTasks) {
inProgress.status = 'FAILED'; inProgress.status = 'FAILED';
inProgress.error = new Error('Lingering task in progress was marked as failed')
await inProgress.save(); await inProgress.save();
} }
} }