Await transactions

Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
Johan Haals
2021-05-03 14:14:57 +02:00
parent 852b6bec95
commit fe84fb2fdc
@@ -37,7 +37,7 @@ class Connection implements EntityProviderConnection {
async applyMutation(mutation: EntityProviderMutation): Promise<void> {
const db = this.config.processingDatabase;
if (mutation.type === 'full') {
db.transaction(async tx => {
await db.transaction(async tx => {
await db.replaceUnprocessedEntities(tx, {
sourceKey: this.config.id,
type: 'full',
@@ -46,7 +46,7 @@ class Connection implements EntityProviderConnection {
});
return;
}
db.transaction(async tx => {
await db.transaction(async tx => {
await db.replaceUnprocessedEntities(tx, {
sourceKey: this.config.id,
type: 'delta',