Parallelize SQL queries
This commit is contained in:
parent
86b4da1ec2
commit
c64762858e
178 changed files with 3377 additions and 3618 deletions
|
@ -23,7 +23,7 @@ import type {
|
|||
import { backupsService } from '../../services/backups';
|
||||
import { isUnsupportedMessage } from '../../state/selectors/message';
|
||||
import { generateAci, generatePni } from '../../types/ServiceId';
|
||||
import Data from '../../sql/Client';
|
||||
import { DataReader, DataWriter } from '../../sql/Client';
|
||||
import { getRandomBytes } from '../../Crypto';
|
||||
import * as Bytes from '../../Bytes';
|
||||
|
||||
|
@ -145,7 +145,7 @@ export async function symmetricRoundtripHarness(
|
|||
}
|
||||
|
||||
async function updateConvoIdToTitle() {
|
||||
const all = await Data.getAllConversations();
|
||||
const all = await DataReader.getAllConversations();
|
||||
for (const convo of all) {
|
||||
CONVO_ID_TO_STABLE_ID.set(
|
||||
convo.id,
|
||||
|
@ -167,7 +167,7 @@ export async function asymmetricRoundtripHarness(
|
|||
try {
|
||||
const targetOutputFile = path.join(outDir, 'backup.bin');
|
||||
|
||||
await Data.saveMessages(before, { forceSave: true, ourAci: OUR_ACI });
|
||||
await DataWriter.saveMessages(before, { forceSave: true, ourAci: OUR_ACI });
|
||||
|
||||
await backupsService.exportToDisk(targetOutputFile, options.backupLevel);
|
||||
|
||||
|
@ -177,7 +177,7 @@ export async function asymmetricRoundtripHarness(
|
|||
|
||||
await backupsService.importBackup(() => createReadStream(targetOutputFile));
|
||||
|
||||
const messagesFromDatabase = await Data._getAllMessages();
|
||||
const messagesFromDatabase = await DataReader._getAllMessages();
|
||||
|
||||
await updateConvoIdToTitle();
|
||||
|
||||
|
@ -199,9 +199,9 @@ export async function asymmetricRoundtripHarness(
|
|||
}
|
||||
|
||||
async function clearData() {
|
||||
await Data._removeAllMessages();
|
||||
await Data._removeAllConversations();
|
||||
await Data.removeAllItems();
|
||||
await DataWriter._removeAllMessages();
|
||||
await DataWriter._removeAllConversations();
|
||||
await DataWriter.removeAllItems();
|
||||
window.storage.reset();
|
||||
window.ConversationController.reset();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue