You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-15 23:00:36 +02:00
sync in bg
This commit is contained in:
@ -148,6 +148,15 @@ class Synchronizer {
|
||||
|
||||
async start(options = null) {
|
||||
if (!options) options = {};
|
||||
|
||||
if (this.state() != 'idle') {
|
||||
let error = new Error(_('Synchronization is already in progress. State: %s', this.state()));
|
||||
error.code = 'alreadyStarted';
|
||||
throw error;
|
||||
//this.logger().info('Synchronization is already in progress. State: ' + this.state());
|
||||
return;
|
||||
}
|
||||
|
||||
this.onProgress_ = options.onProgress ? options.onProgress : function(o) {};
|
||||
this.progressReport_ = { errors: [] };
|
||||
|
||||
@ -155,11 +164,6 @@ class Synchronizer {
|
||||
|
||||
const syncTargetId = this.api().syncTargetId();
|
||||
|
||||
if (this.state() != 'idle') {
|
||||
this.logger().info('Synchronization is already in progress. State: ' + this.state());
|
||||
return;
|
||||
}
|
||||
|
||||
this.randomFailureChoice_ = Math.floor(Math.random() * 5);
|
||||
this.cancelling_ = false;
|
||||
|
||||
|
Reference in New Issue
Block a user