diff options
author | Victor Shyba <victor.shyba@gmail.com> | 2015-07-13 18:23:31 +0200 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-08-11 17:00:22 +0200 |
commit | 7a86ea479898138da70a26b03dbb8759a5d50328 (patch) | |
tree | aa647fd8466b6108cbe8bd41afbb85e5c1dc1d1b /service/pixelated/adapter | |
parent | 9b3e15f3ccb3f06fa42e0563b58370b07ca10887 (diff) |
setup search engine using inlineCallbacks
Diffstat (limited to 'service/pixelated/adapter')
-rw-r--r-- | service/pixelated/adapter/soledad/soledad_search_key_masterkey_retrieval_mixin.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/service/pixelated/adapter/soledad/soledad_search_key_masterkey_retrieval_mixin.py b/service/pixelated/adapter/soledad/soledad_search_key_masterkey_retrieval_mixin.py index 05d32779..8a912bc2 100644 --- a/service/pixelated/adapter/soledad/soledad_search_key_masterkey_retrieval_mixin.py +++ b/service/pixelated/adapter/soledad/soledad_search_key_masterkey_retrieval_mixin.py @@ -21,7 +21,11 @@ import base64 class SoledadSearchIndexMasterkeyRetrievalMixin(SoledadDbFacadeMixin, object): def get_index_masterkey(self): - result = self.get_search_index_masterkey() + deferred = self.get_search_index_masterkey() + deferred.addCallback(self._ensure_masterkey_exists) + return deferred + + def _ensure_masterkey_exists(self, result): index_key_doc = result[0] if result else None if not index_key_doc: |