You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-29 22:48:10 +02:00
sync in bg
This commit is contained in:
@@ -115,12 +115,20 @@ reg.scheduleSync = async (delay = null) => {
|
||||
return;
|
||||
}
|
||||
|
||||
const sync = await reg.synchronizer();
|
||||
const sync = await reg.synchronizer(Setting.value('sync.target'));
|
||||
|
||||
let context = Setting.value('sync.context');
|
||||
context = context ? JSON.parse(context) : {};
|
||||
let newContext = await sync.start({ context: context });
|
||||
Setting.setValue('sync.context', JSON.stringify(newContext));
|
||||
try {
|
||||
let newContext = await sync.start({ context: context });
|
||||
Setting.setValue('sync.context', JSON.stringify(newContext));
|
||||
} catch (error) {
|
||||
if (error.code == 'alreadyStarted') {
|
||||
reg.logger.info(error.message);
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}, delay);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user