mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
sync checks for note_contents
This commit is contained in:
parent
27f74489fd
commit
be378f71b0
@ -430,6 +430,7 @@ async function runSyncRowChecks(entityName, key) {
|
||||
|
||||
async function findSyncRowsIssues() {
|
||||
await runSyncRowChecks("notes", "noteId");
|
||||
await runSyncRowChecks("note_contents", "noteId");
|
||||
await runSyncRowChecks("note_revisions", "noteRevisionId");
|
||||
await runSyncRowChecks("branches", "branchId");
|
||||
await runSyncRowChecks("recent_notes", "branchId");
|
||||
|
@ -49,7 +49,11 @@ async function sync() {
|
||||
catch (e) {
|
||||
proxyToggle = !proxyToggle;
|
||||
|
||||
if (e.message && (e.message.includes('ECONNREFUSED') || e.message.includes('ERR_CONNECTION_REFUSED'))) {
|
||||
if (e.message &&
|
||||
(e.message.includes('ECONNREFUSED') ||
|
||||
e.message.includes('ERR_CONNECTION_REFUSED') ||
|
||||
e.message.includes('Bad Gateway'))) {
|
||||
|
||||
log.info("No connection to sync server.");
|
||||
|
||||
return {
|
||||
@ -263,9 +267,7 @@ async function getEntityRow(entityName, entityId) {
|
||||
const entity = await sql.getRow(`SELECT * FROM ${entityName} WHERE ${primaryKey} = ?`, [entityId]);
|
||||
|
||||
if (!entity) {
|
||||
console.log(entityName, entityId);
|
||||
|
||||
console.log(`SELECT * FROM ${entityName} WHERE ${primaryKey} = '${entityId}'`);
|
||||
throw new Error(`Entity ${entityName} ${entityId} not found.`);
|
||||
}
|
||||
|
||||
if (['note_contents', 'note_revisions'].includes(entityName) && entity.content !== null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user