Conversation: savePromises for off-queue post-handleDataMessage work
This commit is contained in:
parent
059c971ee2
commit
768ab26a20
5 changed files with 145 additions and 62 deletions
|
@ -122,7 +122,13 @@ export async function queueSyncTasks(
|
|||
}
|
||||
drop(
|
||||
conversation.queueJob(innerLogId, async () => {
|
||||
log.info(`${innerLogId}: Starting...`);
|
||||
const promises = conversation.getSavePromises();
|
||||
log.info(
|
||||
`${innerLogId}: Waiting for message saves (${promises.length} items)...`
|
||||
);
|
||||
await Promise.all(promises);
|
||||
|
||||
log.info(`${innerLogId}: Starting delete...`);
|
||||
const result = await deleteConversation(
|
||||
conversation,
|
||||
mostRecentMessages,
|
||||
|
@ -145,7 +151,13 @@ export async function queueSyncTasks(
|
|||
}
|
||||
drop(
|
||||
conversation.queueJob(innerLogId, async () => {
|
||||
log.info(`${innerLogId}: Starting...`);
|
||||
const promises = conversation.getSavePromises();
|
||||
log.info(
|
||||
`${innerLogId}: Waiting for message saves (${promises.length} items)...`
|
||||
);
|
||||
await Promise.all(promises);
|
||||
|
||||
log.info(`${innerLogId}: Starting delete...`);
|
||||
const result = await deleteLocalOnlyConversation(
|
||||
conversation,
|
||||
innerLogId
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue