mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-19 07:58:46 +01:00
Parallelize SQL queries
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user