changed order of syncs to maybe improve racing problems

This commit is contained in:
azivner 2017-12-16 12:30:37 -05:00
parent 0c0e95b91e
commit 03d86209ca
2 changed files with 9 additions and 9 deletions

View File

@ -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" };

View File

@ -243,6 +243,14 @@ async function sendEntity(syncContext, entity, entityName) {
}
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 notPushedSyncs = await sql.getSingleValue("SELECT COUNT(*) FROM sync WHERE id > ?", [lastSyncedPush]);
@ -252,14 +260,6 @@ async function checkContentHash(syncContext) {
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();
let allChecksPassed = true;