summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-06-04 10:22:34 -0400
committerKali Kaneko <kali@leap.se>2015-06-05 16:50:46 -0400
commitddd67ecc07c10f0b48e9f14839c1a8a172d87f1c (patch)
treeb89958d622a5ca48491ff6d43d6e0fac445f329e /mail
parent16dedad1a467693aebf3c8f2a100bf8c8bef9ae3 (diff)
[bug] prevent missing uid table exception
Diffstat (limited to 'mail')
-rw-r--r--mail/src/leap/mail/mail.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/mail/src/leap/mail/mail.py b/mail/src/leap/mail/mail.py
index fe8226e..8cb0b4a 100644
--- a/mail/src/leap/mail/mail.py
+++ b/mail/src/leap/mail/mail.py
@@ -615,8 +615,13 @@ class MessageCollection(object):
return defer.succeed("mdoc_id not inserted")
# XXX BUG -----------------------------------------
- return self.mbox_indexer.insert_doc(
- self.mbox_uuid, doc_id)
+ # XXX BUG sometimes the table is not yet created,
+ # so workaround is to make sure we always check for it before
+ # inserting the doc. I should debug into the real cause.
+ d = self.mbox_indexer.create_table(self.mbox_uuid)
+ d.addCallback(lambda _: self.mbox_indexer.insert_doc(
+ self.mbox_uuid, doc_id))
+ return d
d = wrapper.create(
self.store,