Feat: Run incremental_vacuum and optimize

This commit is contained in:
Nelson Chan
2023-07-08 04:57:53 +08:00
parent 19873e5b9e
commit 9954ba82e7
3 changed files with 30 additions and 0 deletions

View File

@@ -39,6 +39,8 @@ const clearOldData = async () => {
"DELETE FROM heartbeat WHERE time < DATETIME('now', '-' || ? || ' days') ",
[ parsedPeriod ]
);
await R.exec("PRAGMA optimize;");
} catch (e) {
log.error("clearOldData", `Failed to clear old data: ${e.message}`);
}