diff --git a/packages/client-sync/src/local-sync-worker/sync-process-manager.js b/packages/client-sync/src/local-sync-worker/sync-process-manager.js index 6a2e774f8..3c1efbb61 100644 --- a/packages/client-sync/src/local-sync-worker/sync-process-manager.js +++ b/packages/client-sync/src/local-sync-worker/sync-process-manager.js @@ -49,7 +49,7 @@ class SyncProcessManager { // DB fs.unlinkSync(`${NylasEnv.getConfigDirPath()}/edgehill.db`) for (const account of this.accounts()) { - LocalDatabaseConnector.destroyAccountDatabase(account.id) + await LocalDatabaseConnector.destroyAccountDatabase(account.id) } remote.app.relaunch() remote.app.quit() diff --git a/packages/client-sync/src/shared/local-database-connector.js b/packages/client-sync/src/shared/local-database-connector.js index 0d60807e6..9264366f4 100644 --- a/packages/client-sync/src/shared/local-database-connector.js +++ b/packages/client-sync/src/shared/local-database-connector.js @@ -64,7 +64,7 @@ class LocalDatabaseConnector { }); } - destroyAccountDatabase(accountId) { + async destroyAccountDatabase(accountId) { if (NylasEnv.inSpecMode()) { // The db is in memory, so we don't have to unlink it. Just drop the data. return this.forAccount(accountId).then(db => {