mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
changed order of syncs to maybe improve racing problems
This commit is contained in:
parent
0c0e95b91e
commit
03d86209ca
@ -1 +1 @@
|
|||||||
module.exports = { build_date:"2017-12-16T09:02:14-05:00", build_revision: "4381d885243568fe5d4c60dce36bf0c2f98507fe" };
|
module.exports = { build_date:"2017-12-16T12:22:45-05:00", build_revision: "0c0e95b91e6d42c9aaf7921d83630ab36a41e0ae" };
|
||||||
|
@ -243,6 +243,14 @@ async function sendEntity(syncContext, entity, entityName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function checkContentHash(syncContext) {
|
async function checkContentHash(syncContext) {
|
||||||
|
const resp = await syncRequest(syncContext, 'GET', '/api/sync/check');
|
||||||
|
|
||||||
|
if (await getLastSyncedPull() < resp.max_sync_id) {
|
||||||
|
log.info("There are some outstanding pulls, skipping content check.");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const lastSyncedPush = await getLastSyncedPush();
|
const lastSyncedPush = await getLastSyncedPush();
|
||||||
const notPushedSyncs = await sql.getSingleValue("SELECT COUNT(*) FROM sync WHERE id > ?", [lastSyncedPush]);
|
const notPushedSyncs = await sql.getSingleValue("SELECT COUNT(*) FROM sync WHERE id > ?", [lastSyncedPush]);
|
||||||
|
|
||||||
@ -252,14 +260,6 @@ async function checkContentHash(syncContext) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const resp = await syncRequest(syncContext, 'GET', '/api/sync/check');
|
|
||||||
|
|
||||||
if (await getLastSyncedPull() < resp.max_sync_id) {
|
|
||||||
log.info("There are some outstanding pulls, skipping content check.");
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const hashes = await content_hash.getHashes();
|
const hashes = await content_hash.getHashes();
|
||||||
let allChecksPassed = true;
|
let allChecksPassed = true;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user