1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-02 22:49:09 +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

@@ -100,6 +100,11 @@ reg.scheduleSync = async (delay = null, syncOptions = null) => {
try {
reg.logger().info("Starting scheduled sync");
const options = Object.assign({}, syncOptions, { context: context });
if (!options.saveContextHandler) {
options.saveContextHandler = (newContext) => {
Setting.setValue(contextKey, JSON.stringify(newContext));
}
}
const newContext = await sync.start(options);
Setting.setValue(contextKey, JSON.stringify(newContext));
} catch (error) {