mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 19:05:59 +01:00
show existing backups and anonymized DBs, #4321
This commit is contained in:
@@ -6,8 +6,8 @@ const backupService = require('../../services/backup');
|
||||
const anonymizationService = require('../../services/anonymization');
|
||||
const consistencyChecksService = require('../../services/consistency_checks');
|
||||
|
||||
async function anonymize(req) {
|
||||
return await anonymizationService.createAnonymizedCopy(req.params.type);
|
||||
function getExistingBackups() {
|
||||
return backupService.getExistingBackups();
|
||||
}
|
||||
|
||||
async function backupDatabase() {
|
||||
@@ -22,6 +22,18 @@ function vacuumDatabase() {
|
||||
log.info("Database has been vacuumed.");
|
||||
}
|
||||
|
||||
function findAndFixConsistencyIssues() {
|
||||
consistencyChecksService.runOnDemandChecks(true);
|
||||
}
|
||||
|
||||
function getExistingAnonymizedDatabases() {
|
||||
return anonymizationService.getExistingAnonymizedDatabases();
|
||||
}
|
||||
|
||||
async function anonymize(req) {
|
||||
return await anonymizationService.createAnonymizedCopy(req.params.type);
|
||||
}
|
||||
|
||||
function checkIntegrity() {
|
||||
const results = sql.getRows("PRAGMA integrity_check");
|
||||
|
||||
@@ -32,14 +44,12 @@ function checkIntegrity() {
|
||||
};
|
||||
}
|
||||
|
||||
function findAndFixConsistencyIssues() {
|
||||
consistencyChecksService.runOnDemandChecks(true);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getExistingBackups,
|
||||
backupDatabase,
|
||||
vacuumDatabase,
|
||||
findAndFixConsistencyIssues,
|
||||
getExistingAnonymizedDatabases,
|
||||
anonymize,
|
||||
checkIntegrity
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user