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 { AciString } from '../types/ServiceId';
import type { MessageModel } from '../models/messages';
import { DataReader } from '../sql/Client';
import * as Errors from '../types/errors';
import * as log from '../logging/log';
import { getMessageIdForLogging } from '../util/idForLogging';
@ -66,9 +67,7 @@ export async function onSync(
const logId = `ViewOnceOpenSyncs.onSync(timestamp=${sync.timestamp})`;
try {
const messages = await window.Signal.Data.getMessagesBySentAt(
sync.timestamp
);
const messages = await DataReader.getMessagesBySentAt(sync.timestamp);
const found = messages.find(item => {
const itemSourceAci = item.sourceServiceId;