diff options
-rw-r--r-- | changes/changes_feature_4452_defer_initial_sync | 1 | ||||
-rw-r--r-- | src/leap/bitmask/services/soledad/soledadbootstrapper.py | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/changes/changes_feature_4452_defer_initial_sync b/changes/changes_feature_4452_defer_initial_sync new file mode 100644 index 00000000..44e1d2d2 --- /dev/null +++ b/changes/changes_feature_4452_defer_initial_sync @@ -0,0 +1 @@ +- Do not wait for initial soledad sync to complete to launch mail services. Closes: #4452 diff --git a/src/leap/bitmask/services/soledad/soledadbootstrapper.py b/src/leap/bitmask/services/soledad/soledadbootstrapper.py index 54ef67eb..c672c893 100644 --- a/src/leap/bitmask/services/soledad/soledadbootstrapper.py +++ b/src/leap/bitmask/services/soledad/soledadbootstrapper.py @@ -28,6 +28,8 @@ from PySide import QtCore from u1db import errors as u1db_errors from zope.proxy import sameProxiedObjects +from twisted.internet.threads import deferToThread + from leap.bitmask.config import flags from leap.bitmask.config.providerconfig import ProviderConfig from leap.bitmask.crypto.srpauth import SRPAuth @@ -194,7 +196,12 @@ class SoledadBootstrapper(AbstractBootstrapper): leap_assert(not sameProxiedObjects(self._soledad, None), "Null soledad, error while initializing") + self.deferred = deferToThread(self._do_soledad_sync) + def _do_soledad_sync(self): + """ + Does several retries to get an initial soledad sync. + """ # and now, let's sync sync_tries = self.MAX_SYNC_RETRIES while sync_tries > 0: |