mirror of
https://github.com/zadam/trilium.git
synced 2025-11-05 04:45:47 +01:00
sync fixes
This commit is contained in:
@@ -758,7 +758,7 @@ class ConsistencyChecks {
|
||||
return `${tableName}: ${count}`;
|
||||
}
|
||||
|
||||
const tables = [ "notes", "revisions", "attachments", "branches", "attributes", "etapi_tokens" ];
|
||||
const tables = [ "notes", "revisions", "attachments", "branches", "attributes", "etapi_tokens", "blobs" ];
|
||||
|
||||
log.info(`Table counts: ${tables.map(tableName => getTableRowCount(tableName)).join(", ")}`);
|
||||
}
|
||||
@@ -767,7 +767,13 @@ class ConsistencyChecks {
|
||||
let elapsedTimeMs;
|
||||
|
||||
await syncMutexService.doExclusively(() => {
|
||||
elapsedTimeMs = this.runChecksInner();
|
||||
const startTimeMs = Date.now();
|
||||
|
||||
this.runDbDiagnostics();
|
||||
|
||||
this.runAllChecksAndFixers();
|
||||
|
||||
elapsedTimeMs = Date.now() - startTimeMs;
|
||||
});
|
||||
|
||||
if (this.unrecoveredConsistencyErrors) {
|
||||
@@ -781,16 +787,6 @@ class ConsistencyChecks {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
runChecksInner() {
|
||||
const startTimeMs = Date.now();
|
||||
|
||||
this.runDbDiagnostics();
|
||||
|
||||
this.runAllChecksAndFixers();
|
||||
|
||||
return Date.now() - startTimeMs;
|
||||
}
|
||||
}
|
||||
|
||||
function getBlankContent(isProtected, type, mime) {
|
||||
@@ -825,11 +821,6 @@ async function runOnDemandChecks(autoFix) {
|
||||
await consistencyChecks.runChecks();
|
||||
}
|
||||
|
||||
function runOnDemandChecksWithoutExclusiveLock(autoFix) {
|
||||
const consistencyChecks = new ConsistencyChecks(autoFix);
|
||||
consistencyChecks.runChecksInner();
|
||||
}
|
||||
|
||||
function runEntityChangesChecks() {
|
||||
const consistencyChecks = new ConsistencyChecks(true);
|
||||
consistencyChecks.findEntityChangeIssues();
|
||||
@@ -844,6 +835,5 @@ sqlInit.dbReady.then(() => {
|
||||
|
||||
module.exports = {
|
||||
runOnDemandChecks,
|
||||
runOnDemandChecksWithoutExclusiveLock,
|
||||
runEntityChangesChecks
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user