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

@@ -29,7 +29,7 @@ async function initSyncedOptions(username, password) {
await passwordEncryptionService.setDataKey(password, utils.randomSecureToken(16));
}
async function initNotSyncedOptions(initialized, startNotePath = '', syncServerHost = '', syncProxy = '') {
async function initNotSyncedOptions(initialized, startNotePath = 'root', syncServerHost = '', syncProxy = '') {
await optionService.createOption('startNotePath', startNotePath, false);
await optionService.createOption('lastBackupDate', dateUtils.nowDate(), false);
await optionService.createOption('dbVersion', appInfo.dbVersion, false);

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);