diff options
Diffstat (limited to 'service')
-rw-r--r-- | service/pixelated/adapter/services/mail_service.py | 3 | ||||
-rw-r--r-- | service/pixelated/config/services.py | 11 | ||||
-rw-r--r-- | service/test/support/integration/app_test_client.py | 2 | ||||
-rw-r--r-- | service/test/unit/adapter/test_mail_service.py | 3 |
4 files changed, 7 insertions, 12 deletions
diff --git a/service/pixelated/adapter/services/mail_service.py b/service/pixelated/adapter/services/mail_service.py index ee8e562a..789d159e 100644 --- a/service/pixelated/adapter/services/mail_service.py +++ b/service/pixelated/adapter/services/mail_service.py @@ -21,9 +21,8 @@ from pixelated.adapter.services.tag_service import extract_reserved_tags class MailService(object): - def __init__(self, mail_sender, mail_store, soledad_querier, search_engine): + def __init__(self, mail_sender, mail_store, search_engine): self.mail_store = mail_store - self.querier = soledad_querier self.search_engine = search_engine self.mail_sender = mail_sender diff --git a/service/pixelated/config/services.py b/service/pixelated/config/services.py index 9e3227da..0a689a4b 100644 --- a/service/pixelated/config/services.py +++ b/service/pixelated/config/services.py @@ -38,17 +38,15 @@ class Services(object): self.keymanager = leap_session.nicknym self.draft_service = self.setup_draft_service(leap_session.mail_store) - yield self.post_setup(soledad_querier, leap_session) + yield self.index_all_mails() def wrap_mail_store_with_indexing_mail_store(self, leap_session): leap_session.mail_store = SearchableMailStore(leap_session.mail_store, self.search_engine) @defer.inlineCallbacks - def post_setup(self, soledad_querier, leap_session): - self.search_engine.index_mails( - mails=(yield self.mail_service.all_mails())) - # yield soledad_querier.mark_all_as_not_recent() - # yield soledad_querier.remove_duplicates() + def index_all_mails(self): + all_mails = yield self.mail_service.all_mails() + self.search_engine.index_mails(all_mails) @defer.inlineCallbacks def setup_search_engine(self, leap_home, search_index_storage_key): @@ -67,7 +65,6 @@ class Services(object): return MailService( pixelated_mail_sender, leap_session.mail_store, - soledad_querier, search_engine) def setup_draft_service(self, mail_store): diff --git a/service/test/support/integration/app_test_client.py b/service/test/support/integration/app_test_client.py index e44a8c10..089b62d7 100644 --- a/service/test/support/integration/app_test_client.py +++ b/service/test/support/integration/app_test_client.py @@ -175,7 +175,7 @@ class AppTestClient(object): return mail_sender def _create_mail_service(self, mail_sender, mail_store, soledad_querier, search_engine): - mail_service = MailService(mail_sender, mail_store, soledad_querier, search_engine) + mail_service = MailService(mail_sender, mail_store, search_engine) return mail_service def _generate_soledad_test_folder_name(self, soledad_test_folder='/tmp/soledad-test/test'): diff --git a/service/test/unit/adapter/test_mail_service.py b/service/test/unit/adapter/test_mail_service.py index 30784769..677745f2 100644 --- a/service/test/unit/adapter/test_mail_service.py +++ b/service/test/unit/adapter/test_mail_service.py @@ -27,7 +27,6 @@ from twisted.internet import defer class TestMailService(unittest.TestCase): def setUp(self): self.drafts = mock() - self.querier = mock() self.mail_store = mock() self.mailboxes = mock() @@ -38,7 +37,7 @@ class TestMailService(unittest.TestCase): self.mail_sender = mock() self.search_engine = mock() - self.mail_service = MailService(self.mail_sender, self.mail_store, self.querier, self.search_engine) + self.mail_service = MailService(self.mail_sender, self.mail_store, self.search_engine) def tearDown(self): unstub() |