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

@ -9,7 +9,7 @@ import { User } from './storage/User';
import { Blocked } from './storage/Blocked';
import { assertDev } from '../util/assert';
import Data from '../sql/Client';
import { DataReader, DataWriter } from '../sql/Client';
import type { SignalProtocolStore } from '../SignalProtocolStore';
import * as log from '../logging/log';
@ -81,7 +81,7 @@ export class Storage implements StorageInterface {
}
this.items[key] = value;
await window.Signal.Data.createOrUpdateItem({ id: key, value });
await DataWriter.createOrUpdateItem({ id: key, value });
window.reduxActions?.items.putItemExternal(key, value);
}
@ -92,7 +92,7 @@ export class Storage implements StorageInterface {
}
delete this.items[key];
await Data.removeItemById(key);
await DataWriter.removeItemById(key);
window.reduxActions?.items.removeItemExternal(key);
}
@ -110,7 +110,7 @@ export class Storage implements StorageInterface {
public async fetch(): Promise<void> {
this.reset();
Object.assign(this.items, await Data.getAllItems());
Object.assign(this.items, await DataReader.getAllItems());
this.ready = true;
this.callListeners();