mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-03 01:52:42 +00:00
Comment out history testing values
This commit is contained in:
@@ -4,28 +4,28 @@ export const HISTORY_PREFIX = 'HOMEBREWERY-HISTORY';
|
|||||||
export const HISTORY_SLOTS = 5;
|
export const HISTORY_SLOTS = 5;
|
||||||
|
|
||||||
// History values in minutes
|
// History values in minutes
|
||||||
// const HISTORY_SAVE_DELAYS = {
|
|
||||||
// '0' : 0,
|
|
||||||
// '1' : 2,
|
|
||||||
// '2' : 10,
|
|
||||||
// '3' : 60,
|
|
||||||
// '4' : 12 * 60,
|
|
||||||
// '5' : 2 * 24 * 60
|
|
||||||
// };
|
|
||||||
const HISTORY_SAVE_DELAYS = {
|
const HISTORY_SAVE_DELAYS = {
|
||||||
'0' : 0,
|
'0' : 0,
|
||||||
'1' : 1,
|
'1' : 2,
|
||||||
'2' : 2,
|
'2' : 10,
|
||||||
'3' : 3,
|
'3' : 60,
|
||||||
'4' : 4,
|
'4' : 12 * 60,
|
||||||
'5' : 5
|
'5' : 2 * 24 * 60
|
||||||
};
|
};
|
||||||
|
// const HISTORY_SAVE_DELAYS = {
|
||||||
|
// '0' : 0,
|
||||||
|
// '1' : 1,
|
||||||
|
// '2' : 2,
|
||||||
|
// '3' : 3,
|
||||||
|
// '4' : 4,
|
||||||
|
// '5' : 5
|
||||||
|
// };
|
||||||
|
|
||||||
const HB_DB = 'HOMEBREWERY-DB';
|
const HB_DB = 'HOMEBREWERY-DB';
|
||||||
const HB_STORE = 'HISTORY';
|
const HB_STORE = 'HISTORY';
|
||||||
|
|
||||||
// const GARBAGE_COLLECT_DELAY = 28 * 24 * 60;
|
const GARBAGE_COLLECT_DELAY = 28 * 24 * 60;
|
||||||
const GARBAGE_COLLECT_DELAY = 10;
|
// const GARBAGE_COLLECT_DELAY = 10;
|
||||||
|
|
||||||
|
|
||||||
function getKeyBySlot(brew, slot){
|
function getKeyBySlot(brew, slot){
|
||||||
@@ -97,7 +97,7 @@ export async function updateHistory(brew) {
|
|||||||
// Update the most recent brew
|
// Update the most recent brew
|
||||||
historyUpdate.push(parseBrewForStorage(brew, 1));
|
historyUpdate.push(parseBrewForStorage(brew, 1));
|
||||||
|
|
||||||
IDB.setMany(historyUpdate, await createHBStore());
|
await IDB.setMany(historyUpdate, await createHBStore());
|
||||||
|
|
||||||
// Break out of data checks because we found an expired value
|
// Break out of data checks because we found an expired value
|
||||||
break;
|
break;
|
||||||
@@ -113,7 +113,7 @@ export async function versionHistoryGarbageCollection(){
|
|||||||
const expireAt = new Date(value.savedAt);
|
const expireAt = new Date(value.savedAt);
|
||||||
expireAt.setMinutes(expireAt.getMinutes() + GARBAGE_COLLECT_DELAY);
|
expireAt.setMinutes(expireAt.getMinutes() + GARBAGE_COLLECT_DELAY);
|
||||||
if(new Date() > expireAt){
|
if(new Date() > expireAt){
|
||||||
IDB.del(key, await createHBStore());
|
await IDB.del(key, await createHBStore());
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user