1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

All: Fixes #600: Improved resuming of long sync operations so that it doesn't needlessly re-download the items from the beginning

This commit is contained in:
Laurent Cozic
2018-06-10 23:16:27 +01:00
parent ab9675544c
commit b6619b41df
4 changed files with 16 additions and 2 deletions

View File

@ -570,6 +570,15 @@ class Synchronizer {
// items being synced twice as an update. If the local and remote items are identical
// the update will simply be skipped.
if (!hasCancelled) {
if (options.saveContextHandler) {
const deltaToSave = Object.assign({}, listResult.context);
// Remove these two variables because they can be large and can be rebuilt
// the next time the sync is started.
delete deltaToSave.statsCache;
delete deltaToSave.statIdsCache;
options.saveContextHandler({ delta: deltaToSave });
}
if (!listResult.hasMore) {
newDeltaContext = listResult.context;
break;