Preparing

This commit is contained in:
Louis Lam
2024-09-01 17:19:18 +08:00
parent c567e8eb8e
commit 2dfa6886b4
2 changed files with 20 additions and 0 deletions

View File

@@ -11,6 +11,17 @@ const DEFAULT_KEEP_PERIOD = 180;
*/
const clearOldData = async () => {
/*
* TODO:
* Since we have aggregated table now, we don't need so much data in heartbeat table.
* But we still need to keep the important rows, because they contain the message.
*
* In the heartbeat table:
* - important rows: keep according to the setting (keepDataPeriodDays) (default 180 days)
* - not important rows: keep 2 days
*/
let period = await setting("keepDataPeriodDays");
// Set Default Period