diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-07-17 15:25:53 +0200 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-08-11 17:00:24 +0200 |
commit | 3fd817a57040846c37e8daafa587b85292dd8a76 (patch) | |
tree | 3248ab30dd15c8b3edf55d1d6883fe500a72f86d /service/pixelated | |
parent | e3a98eb55bf9d74163876698424e96ab1dad9ac6 (diff) |
Some more yields.
Diffstat (limited to 'service/pixelated')
-rw-r--r-- | service/pixelated/adapter/soledad/soledad_facade_mixin.py | 3 | ||||
-rw-r--r-- | service/pixelated/adapter/soledad/soledad_writer_mixin.py | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/service/pixelated/adapter/soledad/soledad_facade_mixin.py b/service/pixelated/adapter/soledad/soledad_facade_mixin.py index e5dbb458..d3baa64b 100644 --- a/service/pixelated/adapter/soledad/soledad_facade_mixin.py +++ b/service/pixelated/adapter/soledad/soledad_facade_mixin.py @@ -57,9 +57,10 @@ class SoledadDbFacadeMixin(object): def create_doc(self, doc): return self.soledad.create_doc(doc) + @defer.inlineCallbacks def create_docs(self, docs): for doc in docs: - self.create_doc(doc) + yield self.create_doc(doc) def delete_doc(self, doc): return self.soledad.delete_doc(doc) diff --git a/service/pixelated/adapter/soledad/soledad_writer_mixin.py b/service/pixelated/adapter/soledad/soledad_writer_mixin.py index 262351cb..43e5d323 100644 --- a/service/pixelated/adapter/soledad/soledad_writer_mixin.py +++ b/service/pixelated/adapter/soledad/soledad_writer_mixin.py @@ -38,7 +38,7 @@ class SoledadWriterMixin(SoledadDbFacadeMixin, object): mbox_doc = (yield self.get_mbox(mailbox_name))[0] uid = 1 + (yield self.get_lastuid(mbox_doc)) - self.create_docs(mail.get_for_save(next_uid=uid, mailbox=mailbox_name)) + yield self.create_docs(mail.get_for_save(next_uid=uid, mailbox=mailbox_name)) # FIXME need to update meta message (mdoc) # mbox_doc.content['lastuid'] = uid + 1 |