Parallelize SQL queries

This commit is contained in:
Fedor Indutny 2024-07-22 11:16:33 -07:00 committed by GitHub
parent 86b4da1ec2
commit c64762858e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
178 changed files with 3377 additions and 3618 deletions

View file

@ -3,6 +3,7 @@
import type { CallLogEventSyncEvent } from '../textsecure/messageReceiverEvents';
import * as log from '../logging/log';
import { DataWriter } from '../sql/Client';
import type { CallLogEventTarget } from '../types/CallDisposition';
import { CallLogEvent } from '../types/CallDisposition';
import { missingCaseError } from './missingCaseError';
@ -28,7 +29,7 @@ export async function onCallLogEventSync(
if (type === CallLogEvent.Clear) {
log.info('onCallLogEventSync: Clearing call history');
try {
const messageIds = await window.Signal.Data.clearCallHistory(target);
const messageIds = await DataWriter.clearCallHistory(target);
updateDeletedMessages(messageIds);
} finally {
// We want to reset the call history even if the clear fails.
@ -38,7 +39,7 @@ export async function onCallLogEventSync(
} else if (type === CallLogEvent.MarkedAsRead) {
log.info('onCallLogEventSync: Marking call history read');
try {
await window.Signal.Data.markAllCallHistoryRead(target);
await DataWriter.markAllCallHistoryRead(target);
} finally {
window.reduxActions.callHistory.updateCallHistoryUnreadCount();
}
@ -47,7 +48,7 @@ export async function onCallLogEventSync(
log.info('onCallLogEventSync: Marking call history read in conversation');
try {
strictAssert(peerId, 'Missing peerId');
await window.Signal.Data.markAllCallHistoryReadInConversation(target);
await DataWriter.markAllCallHistoryReadInConversation(target);
} finally {
window.reduxActions.callHistory.updateCallHistoryUnreadCount();
}