[local-sync] properly cleanup broken messages

This commit is contained in:
Evan Morikawa 2017-02-01 06:57:30 -08:00
parent 04ff46eb04
commit efba50bd9f

View file

@ -96,9 +96,8 @@ class SyncWorker {
const noFolderImapUID = await Message.findAll({
where: {
folderImapUID: null,
isProcessed: true,
},
})
}).filter(m => Date.now() - m.date > 10 * 60 * 1000) // 10 min
const affectedThreadIds = new Set();
await Promise.map(orphans.concat(noFolderImapUID), (msg) => {
affectedThreadIds.add(msg.threadId);