Improve message download performance

This commit is contained in:
Scott Nonnenberg 2019-09-26 12:56:31 -07:00
parent 957f6f6474
commit 0c09f9620f
32 changed files with 906 additions and 633 deletions

View file

@ -166,9 +166,11 @@ async function _runJob(job) {
);
}
const found = await getMessageById(messageId, {
Message: Whisper.Message,
});
const found =
MessageController.getById(messageId) ||
(await getMessageById(messageId, {
Message: Whisper.Message,
}));
if (!found) {
logger.error('_runJob: Source message not found, deleting job');
await _finishJob(null, id);
@ -434,13 +436,7 @@ async function _addAttachmentToMessage(message, attachment, { type, index }) {
hash: await computeHash(loadedAttachment.data),
},
});
await Signal.Data.updateConversation(
conversationId,
conversation.attributes,
{
Conversation: Whisper.Conversation,
}
);
Signal.Data.updateConversation(conversationId, conversation.attributes);
return;
}