summaryrefslogtreecommitdiff
path: root/service/pixelated/adapter
diff options
context:
space:
mode:
authorFolker Bernitt <fbernitt@thoughtworks.com>2016-02-01 17:30:26 +0100
committerFolker Bernitt <fbernitt@thoughtworks.com>2016-02-02 09:35:28 +0100
commitb77b15c76d48d4fd3f5d9bb856801cb810a659b2 (patch)
treeab9cf82d9842645714af6e8c8155ff8c76e7fa6b /service/pixelated/adapter
parente3939d4c1dff0f152fa13ce8a89f751c79ecace2 (diff)
Don't load attachments when just listing mails
Diffstat (limited to 'service/pixelated/adapter')
-rw-r--r--service/pixelated/adapter/listeners/mailbox_indexer_listener.py2
-rw-r--r--service/pixelated/adapter/mailstore/leap_mailstore.py6
-rw-r--r--service/pixelated/adapter/mailstore/mailstore.py2
3 files changed, 5 insertions, 5 deletions
diff --git a/service/pixelated/adapter/listeners/mailbox_indexer_listener.py b/service/pixelated/adapter/listeners/mailbox_indexer_listener.py
index e2f46769..74b4f5af 100644
--- a/service/pixelated/adapter/listeners/mailbox_indexer_listener.py
+++ b/service/pixelated/adapter/listeners/mailbox_indexer_listener.py
@@ -47,7 +47,7 @@ class MailboxIndexerListener(object):
missing_idents = soledad_idents.difference(indexed_idents)
- self.search_engine.index_mails((yield self.mail_store.get_mails(missing_idents)))
+ self.search_engine.index_mails((yield self.mail_store.get_mails(missing_idents, include_body=True)))
except Exception, e: # this is a event handler, don't let exceptions escape
logger.error(e)
diff --git a/service/pixelated/adapter/mailstore/leap_mailstore.py b/service/pixelated/adapter/mailstore/leap_mailstore.py
index 9b62b3ba..e517ec4c 100644
--- a/service/pixelated/adapter/mailstore/leap_mailstore.py
+++ b/service/pixelated/adapter/mailstore/leap_mailstore.py
@@ -205,10 +205,10 @@ class LeapMailStore(MailStore):
defer.returnValue(leap_mail)
@defer.inlineCallbacks
- def get_mails(self, mail_ids, gracefully_ignore_errors=False):
+ def get_mails(self, mail_ids, gracefully_ignore_errors=False, include_body=False):
deferreds = []
for mail_id in mail_ids:
- deferreds.append(self.get_mail(mail_id, include_body=True))
+ deferreds.append(self.get_mail(mail_id, include_body=include_body))
if gracefully_ignore_errors:
results = yield DeferredList(deferreds, consumeErrors=True)
@@ -230,7 +230,7 @@ class LeapMailStore(MailStore):
mail_ids = map(lambda doc: doc.doc_id, mdocs)
- mails = yield self.get_mails(mail_ids, gracefully_ignore_errors=gracefully_ignore_errors)
+ mails = yield self.get_mails(mail_ids, gracefully_ignore_errors=gracefully_ignore_errors, include_body=True)
defer.returnValue(mails)
@defer.inlineCallbacks
diff --git a/service/pixelated/adapter/mailstore/mailstore.py b/service/pixelated/adapter/mailstore/mailstore.py
index 60716dfe..fbd7fc9e 100644
--- a/service/pixelated/adapter/mailstore/mailstore.py
+++ b/service/pixelated/adapter/mailstore/mailstore.py
@@ -22,7 +22,7 @@ class MailStore(object):
def get_mail_attachment(self, attachment_id):
pass
- def get_mails(self, mail_ids):
+ def get_mails(self, mail_ids, gracefully_ignore_errors=False, include_body=False):
pass
def all_mails(self):