From 048e077cc56a56ee94320ee2b981b979bf615c38 Mon Sep 17 00:00:00 2001 From: Evan Morikawa Date: Mon, 28 Nov 2016 10:39:23 -0800 Subject: [PATCH] [local-sync] retry sync after error --- packages/local-sync/src/local-sync-worker/sync-worker.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/local-sync/src/local-sync-worker/sync-worker.js b/packages/local-sync/src/local-sync-worker/sync-worker.js index 33a62ca28..f84af2017 100644 --- a/packages/local-sync/src/local-sync-worker/sync-worker.js +++ b/packages/local-sync/src/local-sync-worker/sync-worker.js @@ -152,9 +152,8 @@ class SyncWorker { this._account.reload().then(() => { console.log(this._account) - if (!process.env.SYNC_AFTER_ERRORS && this._account.errored()) { - this._logger.error(`SyncWorker: Account is in error state - Skipping sync\n${this._account.syncError.message}`, this._account.syncError.stack.join('\n')) - return Promise.resolve(); + if (this._account.errored()) { + this._logger.error(`SyncWorker: Account is in error state - Retrying sync\n${this._account.syncError.message}`, this._account.syncError.stack.join('\n')) } this._logger.info({reason}, `SyncWorker: Account sync started`)