diff options
author | Kali Kaneko <kali@leap.se> | 2014-01-15 17:05:24 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2014-01-15 21:32:59 -0400 |
commit | 90f4338da088394ade1663871a23b8fb0a4c0d66 (patch) | |
tree | 8d5a03f771a929ac2b0e61dd5a5a64fa0730ed0d /src/leap/mail/imap/messages.py | |
parent | fc7ef201ea169e76123e15db346ac8d882d93c02 (diff) |
Performance improvement on FLAGS-only FETCH
* Compute the intersection set of the uids on a FETCH, so we avoid
iterating through the non-existant UIDs.
* Dispatch FLAGS query to our specialized method, that fetches all the
flags documents and return objects that only specify one subset of the
MessagePart interface, apt to render flags quickly with less queries
overhead.
* Overwrite the do_FETCH command in the imap Server to use fetch_flags.
* Use deferLater for a better dispatch of tasks in the reactor.
Diffstat (limited to 'src/leap/mail/imap/messages.py')
-rw-r--r-- | src/leap/mail/imap/messages.py | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/leap/mail/imap/messages.py b/src/leap/mail/imap/messages.py index b35b808..22de356 100644 --- a/src/leap/mail/imap/messages.py +++ b/src/leap/mail/imap/messages.py @@ -662,17 +662,8 @@ class LeapMessage(fields, MailParser, MBoxParser): result = first(flag_docs) except Exception as exc: # ugh! Something's broken down there! - logger.warning("FUCKING ERROR ----- getting for UID:", self._uid) + logger.warning("ERROR while getting flags for UID: %s" % self._uid) logger.exception(exc) - try: - flag_docs = self._soledad.get_from_index( - fields.TYPE_MBOX_UID_IDX, - fields.TYPE_FLAGS_VAL, self._mbox, str(self._uid)) - result = first(flag_docs) - except Exception as exc: - # ugh! Something's broken down there! - logger.warning("FUCKING ERROR, 2nd time -----") - logger.exception(exc) finally: return result |