Parallelize SQL queries
This commit is contained in:
parent
86b4da1ec2
commit
c64762858e
178 changed files with 3377 additions and 3618 deletions
|
@ -18,9 +18,7 @@ import { queueAttachmentDownloads } from '../util/queueAttachmentDownloads';
|
|||
import { queueUpdateMessage } from '../util/messageBatcher';
|
||||
import { AttachmentDownloadUrgency } from '../jobs/AttachmentDownloadManager';
|
||||
import { isAciString } from '../util/isAciString';
|
||||
import dataInterface from '../sql/Client';
|
||||
|
||||
const { removeSyncTaskById } = dataInterface;
|
||||
import { DataReader, DataWriter } from '../sql/Client';
|
||||
|
||||
export const viewSyncTaskSchema = z.object({
|
||||
type: z.literal('ViewSync').readonly(),
|
||||
|
@ -42,7 +40,7 @@ export type ViewSyncAttributesType = {
|
|||
const viewSyncs = new Map<string, ViewSyncAttributesType>();
|
||||
|
||||
async function remove(sync: ViewSyncAttributesType): Promise<void> {
|
||||
await removeSyncTaskById(sync.syncTaskId);
|
||||
await DataWriter.removeSyncTaskById(sync.syncTaskId);
|
||||
}
|
||||
|
||||
export async function forMessage(
|
||||
|
@ -92,9 +90,7 @@ export async function onSync(sync: ViewSyncAttributesType): Promise<void> {
|
|||
const logId = `ViewSyncs.onSync(timestamp=${viewSync.timestamp})`;
|
||||
|
||||
try {
|
||||
const messages = await window.Signal.Data.getMessagesBySentAt(
|
||||
viewSync.timestamp
|
||||
);
|
||||
const messages = await DataReader.getMessagesBySentAt(viewSync.timestamp);
|
||||
|
||||
const found = messages.find(item => {
|
||||
const sender = window.ConversationController.lookupOrCreate({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue