better instructions for desktop => server instance sync setup, plus some sync fixes

This commit is contained in:
azivner
2018-07-25 10:57:36 +02:00
parent 50bb4a47ee
commit d39cdbfada
5 changed files with 25 additions and 6 deletions

View File

@@ -131,6 +131,12 @@ async function pushSync(syncContext) {
while (true) {
const syncs = await sql.getRows('SELECT * FROM sync WHERE id > ? LIMIT 1000', [lastSyncedPush]);
if (syncs.length === 0) {
log.info("Nothing to push");
break;
}
const filteredSyncs = syncs.filter(sync => {
if (sync.sourceId === syncContext.sourceId) {
// too noisy
@@ -149,11 +155,11 @@ async function pushSync(syncContext) {
});
if (filteredSyncs.length === 0) {
log.info("Nothing to push");
// there still might be more syncs (because of batch limit), just all from current batch
// has been filtered out
await setLastSyncedPush(lastSyncedPush);
break;
continue;
}
const syncRecords = await getSyncRecords(filteredSyncs);