trilium/src/routes/api/cleanup.js
2019-12-10 22:03:00 +01:00

20 lines
No EOL
480 B
JavaScript

"use strict";
const sql = require('../../services/sql');
const log = require('../../services/log');
const consistencyChecksService = require('../../services/consistency_checks');
async function vacuumDatabase() {
await sql.execute("VACUUM");
log.info("Database has been vacuumed.");
}
async function findAndFixConsistencyIssues() {
await consistencyChecksService.runOnDemandChecks(true);
}
module.exports = {
vacuumDatabase,
findAndFixConsistencyIssues
};