changing durability to relaxed (#2934)

* changing durability to be relaxed

* fix bug

* add QueueDB add to be durability relaxed
This commit is contained in:
Adriana Jara
2021-09-07 14:30:41 -04:00
committed by GitHub
parent e52364e27a
commit c3cfc66a83
2 changed files with 6 additions and 2 deletions
@@ -56,7 +56,9 @@ export class QueueDb {
*/
async addEntry(entry: UnidentifiedQueueStoreEntry): Promise<void> {
const db = await this.getDb();
await db.add(REQUEST_OBJECT_STORE_NAME, entry as QueueStoreEntry);
const tx = db.transaction(REQUEST_OBJECT_STORE_NAME, 'readwrite', { durability: 'relaxed' });
await tx.store.add(entry as QueueStoreEntry);
await tx.done;
}
/**
@@ -111,7 +111,9 @@ class CacheTimestampsModel {
id: this._getId(url),
};
const db = await this.getDb();
await db.put(CACHE_OBJECT_STORE, entry);
const tx = db.transaction(CACHE_OBJECT_STORE, 'readwrite', {durability: 'relaxed'});
await tx.store.put(entry);
await tx.done;
}
/**