Remove cache only save

This commit is contained in:
kwaroran
2024-11-03 22:06:07 +09:00
parent 0fc41e2e44
commit 4f41461f86
3 changed files with 35 additions and 53 deletions

View File

@@ -13,7 +13,6 @@ const risuSession = Date.now().toFixed(0)
const cachedForage = localforage.createInstance({name: "risuaiAccountCached"})
let seenWarnings:string[] = []
let lastDbSave = 0
export class AccountStorage{
auth:string
@@ -26,16 +25,6 @@ export class AccountStorage{
const saveDate = Date.now().toFixed(0)
if(key === 'database/database.bin' && Date.now() - lastDbSave < 10000){
console.log('saving in cache')
//only save in cache if it's database and last save is less than 10 seconds
await cachedForage.setItem(key, value).then(() => {
cachedForage.setItem(key + '__date', saveDate)
})
return key
}
lastDbSave = Date.now()
da = await fetch(hubURL + '/api/account/write', {
method: "POST",
body: value,