mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 02:30:42 +01:00
better instructions for desktop => server instance sync setup, plus some sync fixes
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user