diff --git a/packages/core/src/api/sync/index.ts b/packages/core/src/api/sync/index.ts index 7357a94cf..4a77eee9a 100644 --- a/packages/core/src/api/sync/index.ts +++ b/packages/core/src/api/sync/index.ts @@ -50,7 +50,8 @@ export default class SyncManager { async start(full?: boolean, force?: boolean) { try { - await this.sync.autoSync.start(); + if (await checkSyncStatus(SYNC_CHECK_IDS.autoSync)) + await this.sync.autoSync.start(); await this.sync.start(full, force); return true; } catch (e) { @@ -153,7 +154,6 @@ class Sync { this.connection.onclose((error = new Error("Connection closed.")) => { this.db.eventManager.publish(EVENTS.syncAborted); - console.error(error); this.logger.error(error); throw new Error("Connection closed."); }); @@ -172,6 +172,7 @@ class Sync { if (!(await checkSyncStatus(SYNC_CHECK_IDS.autoSync))) { await this.connection.stop(); + this.autoSync.stop(); } }