summaryrefslogtreecommitdiff
path: root/src/leap/mail/mail.py
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
commit2cf8aa4a285cde6e8bdcaaf1d374b8762d36714c (patch)
tree0121bebea724d951e17162e9b46ca2933e644d95 /src/leap/mail/mail.py
parent4c12d05d063d42171808c432bee90de67c4042b6 (diff)
[bug] prevent missing uid table exception
Diffstat (limited to 'src/leap/mail/mail.py')
-rw-r--r--src/leap/mail/mail.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/leap/mail/mail.py b/src/leap/mail/mail.py
index fe8226e..8cb0b4a 100644
--- a/src/leap/mail/mail.py
+++ b/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,