diff options
author | Kali Kaneko <kali@leap.se> | 2013-11-12 13:39:26 -0200 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2013-11-12 13:39:26 -0200 |
commit | 1fb82f0ad4a2a397e4b938748e58a64d057599e4 (patch) | |
tree | 935e6e8bd7592a4248a0198aa64fa4c3c108a46a /src/leap/bitmask/services | |
parent | 435100feb7d373701fbbac41013b06f46ddb914d (diff) |
deferToThread initial soledad sync
Diffstat (limited to 'src/leap/bitmask/services')
-rw-r--r-- | src/leap/bitmask/services/soledad/soledadbootstrapper.py | 7 |
1 files changed, 7 insertions, 0 deletions
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: |