summaryrefslogtreecommitdiff
path: root/service/pixelated/bitmask_libraries
diff options
context:
space:
mode:
authorFolker Bernitt <fbernitt@thoughtworks.com>2015-07-20 11:08:11 +0200
committerFolker Bernitt <fbernitt@thoughtworks.com>2015-08-11 17:00:25 +0200
commita759db8bc3c3f9b826f3332da11f090e5c758ee5 (patch)
tree13f04d72f2c3e3f805f897fdcbff0aa7bc906937 /service/pixelated/bitmask_libraries
parent9e8ca28f060362e1540deb87153fde4161d39161 (diff)
Enable initial sync and background jobs.
Diffstat (limited to 'service/pixelated/bitmask_libraries')
-rw-r--r--service/pixelated/bitmask_libraries/session.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/service/pixelated/bitmask_libraries/session.py b/service/pixelated/bitmask_libraries/session.py
index d1bdac73..50f5e7c7 100644
--- a/service/pixelated/bitmask_libraries/session.py
+++ b/service/pixelated/bitmask_libraries/session.py
@@ -62,11 +62,12 @@ class LeapSession(object):
self.account = soledad_account
self.incoming_mail_fetcher = incoming_mail_fetcher
- d = self.sync()
- d.addCallback(lambda _: self.nicknym.generate_openpgp_key())
-
- if self.config.start_background_jobs:
- d.addCallback(lambda _: self.start_background_jobs())
+ @defer.inlineCallbacks
+ def initial_sync(self):
+ yield self.sync()
+ yield self.nicknym.generate_openpgp_key()
+ yield self.start_background_jobs()
+ defer.returnValue(self)
def account_email(self):
name = self.user_auth.username
@@ -78,6 +79,7 @@ class LeapSession(object):
@defer.inlineCallbacks
def start_background_jobs(self):
self.incoming_mail_fetcher = yield self.incoming_mail_fetcher
+
reactor.callFromThread(self.incoming_mail_fetcher.startService)
def stop_background_jobs(self):