This commit is contained in:
thuhole
2020-07-21 17:35:15 +08:00
parent 7636e45c00
commit 98881eca9a
17 changed files with 4541 additions and 3621 deletions

View File

@@ -114,6 +114,7 @@ class Cache {
data_str: this.encrypt(pid, data),
last_access: +new Date(),
});
console.log('comment cache put', pid);
if (++this.added_items_since_maintenance === MAINTENANCE_STEP)
setTimeout(this.maintenance.bind(this), 1);
});
@@ -126,7 +127,7 @@ class Cache {
const tx = this.db.transaction(['comment'], 'readwrite');
const store = tx.objectStore('comment');
let req = store.delete(pid);
//console.log('comment cache delete',pid);
console.log('comment cache delete', pid);
req.onerror = () => {
console.warn('comment cache delete failed ', pid);
return resolve();