0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-05 18:52:38 +00:00

Remove unnecessary key check

This commit is contained in:
G.Ambatte
2024-10-07 21:53:24 +13:00
parent 5d9ef3fa6c
commit 7e165c6e61

View File

@@ -143,17 +143,17 @@ export async function versionHistoryGarbageCollection(){
await IDB.entries(await createHBStore()) await IDB.entries(await createHBStore())
.then((entries)=>{ .then((entries)=>{
entries.forEach((entry)=>{ entries.forEach(async (entry)=>{
const key = entry[0]; const key = entry[0];
const value = entry[1]; const value = entry[1];
if(key.startsWith(`${HISTORY_PREFIX}`)) { // if(key.startsWith(`${HISTORY_PREFIX}`)) { // This check was to make sure we were only selecting the history keys, should be unnecessary
const collectAt = new Date(value.savedAt); const collectAt = new Date(value.savedAt);
collectAt.setMinutes(collectAt.getMinutes() + GARBAGE_COLLECT_DELAY); collectAt.setMinutes(collectAt.getMinutes() + GARBAGE_COLLECT_DELAY);
if(new Date() > collectAt){ if(new Date() > collectAt){
IDB.del(key); IDB.del(key, await createHBStore());
}; };
} // }
}); });
}); });
}; };