summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/src/leap/soledad/common/couch.py9
-rw-r--r--server/src/leap/soledad/server/sync.py2
2 files changed, 10 insertions, 1 deletions
diff --git a/common/src/leap/soledad/common/couch.py b/common/src/leap/soledad/common/couch.py
index 014b3f38..00a17715 100644
--- a/common/src/leap/soledad/common/couch.py
+++ b/common/src/leap/soledad/common/couch.py
@@ -443,6 +443,15 @@ class CouchDatabase(CommonBackend):
else:
return {}
+ def init_caching(self, cache):
+ """
+ Start using cache by setting internal _cache attribute.
+
+ :param cache: the cache instance, anything that behaves like a dict
+ :type cache: dict
+ """
+ self._cache = cache
+
def ensure_ddocs_on_db(self):
"""
Ensure that the design documents used by the backend exist on the
diff --git a/server/src/leap/soledad/server/sync.py b/server/src/leap/soledad/server/sync.py
index e4fd1260..619be565 100644
--- a/server/src/leap/soledad/server/sync.py
+++ b/server/src/leap/soledad/server/sync.py
@@ -192,7 +192,7 @@ class SyncResource(http_app.SyncResource):
db = cache['instance']
else:
db = self.state.open_database(self.dbname)
- db._cache = cache
+ db.init_caching(cache)
cache['instance'] = db
# validate the information the client has about server replica
db.validate_gen_and_trans_id(