mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-10 20:03:03 +00:00
Shift GC to use savedAt time
This commit is contained in:
@@ -126,7 +126,7 @@ export function versionHistoryGarbageCollection(){
|
|||||||
return key.startsWith(HISTORY_PREFIX);
|
return key.startsWith(HISTORY_PREFIX);
|
||||||
})
|
})
|
||||||
.forEach((key)=>{
|
.forEach((key)=>{
|
||||||
const collectAt = new Date(JSON.parse(localStorage.getItem(key)).expireAt);
|
const collectAt = new Date(JSON.parse(localStorage.getItem(key)).savedAt);
|
||||||
collectAt.setMinutes(collectAt.getMinutes() + GARBAGE_COLLECT_DELAY);
|
collectAt.setMinutes(collectAt.getMinutes() + GARBAGE_COLLECT_DELAY);
|
||||||
if(new Date() > collectAt){
|
if(new Date() > collectAt){
|
||||||
localStorage.removeItem(key);
|
localStorage.removeItem(key);
|
||||||
|
|||||||
Reference in New Issue
Block a user