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

Per-target sync context

This commit is contained in:
Laurent Cozic
2017-08-19 22:56:28 +02:00
parent 0cf8d3fd74
commit a5daccce09
10 changed files with 39 additions and 27 deletions

View File

@ -161,12 +161,12 @@ reg.scheduleSync = async (delay = null) => {
try {
const sync = await reg.synchronizer(syncTargetId);
let context = Setting.value('sync.context');
const contextKey = 'sync.' + syncTargetId + '.context';
let context = Setting.value(contextKey);
context = context ? JSON.parse(context) : {};
try {
let newContext = await sync.start({ context: context });
Setting.setValue('sync.context', JSON.stringify(newContext));
Setting.setValue(contextKey, JSON.stringify(newContext));
} catch (error) {
if (error.code == 'alreadyStarted') {
reg.logger().info(error.message);