mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 03:46:37 +01:00
fix interrupted initial sync
This commit is contained in:
@@ -371,7 +371,10 @@ function getLastSyncedPull() {
|
||||
|
||||
function setLastSyncedPull(entityChangeId) {
|
||||
const lastSyncedPullOption = becca.getOption('lastSyncedPull');
|
||||
lastSyncedPullOption.value = entityChangeId + '';
|
||||
|
||||
if (lastSyncedPullOption) { // might be null in initial sync when becca is not loaded
|
||||
lastSyncedPullOption.value = entityChangeId + '';
|
||||
}
|
||||
|
||||
// this way we avoid updating entity_changes which otherwise means that we've never pushed all entity_changes
|
||||
sql.execute("UPDATE options SET value = ? WHERE name = ?", [entityChangeId, 'lastSyncedPull']);
|
||||
@@ -389,7 +392,10 @@ function setLastSyncedPush(entityChangeId) {
|
||||
ws.setLastSyncedPush(entityChangeId);
|
||||
|
||||
const lastSyncedPushOption = becca.getOption('lastSyncedPush');
|
||||
lastSyncedPushOption.value = entityChangeId + '';
|
||||
|
||||
if (lastSyncedPushOption) { // might be null in initial sync when becca is not loaded
|
||||
lastSyncedPushOption.value = entityChangeId + '';
|
||||
}
|
||||
|
||||
// this way we avoid updating entity_changes which otherwise means that we've never pushed all entity_changes
|
||||
sql.execute("UPDATE options SET value = ? WHERE name = ?", [entityChangeId, 'lastSyncedPush']);
|
||||
|
||||
Reference in New Issue
Block a user