mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 09:58:32 +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() {
|
async function findSyncRowsIssues() {
|
||||||
await runSyncRowChecks("notes", "noteId");
|
await runSyncRowChecks("notes", "noteId");
|
||||||
|
await runSyncRowChecks("note_contents", "noteId");
|
||||||
await runSyncRowChecks("note_revisions", "noteRevisionId");
|
await runSyncRowChecks("note_revisions", "noteRevisionId");
|
||||||
await runSyncRowChecks("branches", "branchId");
|
await runSyncRowChecks("branches", "branchId");
|
||||||
await runSyncRowChecks("recent_notes", "branchId");
|
await runSyncRowChecks("recent_notes", "branchId");
|
||||||
|
@ -49,7 +49,11 @@ async function sync() {
|
|||||||
catch (e) {
|
catch (e) {
|
||||||
proxyToggle = !proxyToggle;
|
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.");
|
log.info("No connection to sync server.");
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -263,9 +267,7 @@ async function getEntityRow(entityName, entityId) {
|
|||||||
const entity = await sql.getRow(`SELECT * FROM ${entityName} WHERE ${primaryKey} = ?`, [entityId]);
|
const entity = await sql.getRow(`SELECT * FROM ${entityName} WHERE ${primaryKey} = ?`, [entityId]);
|
||||||
|
|
||||||
if (!entity) {
|
if (!entity) {
|
||||||
console.log(entityName, entityId);
|
throw new Error(`Entity ${entityName} ${entityId} not found.`);
|
||||||
|
|
||||||
console.log(`SELECT * FROM ${entityName} WHERE ${primaryKey} = '${entityId}'`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (['note_contents', 'note_revisions'].includes(entityName) && entity.content !== null) {
|
if (['note_contents', 'note_revisions'].includes(entityName) && entity.content !== null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user