summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Shyba <victor.shyba@gmail.com>2015-10-29 16:56:24 -0300
committerVictor Shyba <victor.shyba@gmail.com>2015-11-03 12:41:37 -0300
commit5e47ff186db38b1f610444f19ec57c838efbbf03 (patch)
treeb7b8ab422ef9df1c3f9911bd0712f22a73a32282
parenteaf19626a57d5f5325653fee3aea9db27c9531fe (diff)
[feat] add caching to a place that was missing
When retrieving other replica info the cache wasnt being used, but when saving it was. This commit applies caching on get as well.
-rw-r--r--common/src/leap/soledad/common/backend.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/src/leap/soledad/common/backend.py b/common/src/leap/soledad/common/backend.py
index 2f0ef4f7..deed5ac2 100644
--- a/common/src/leap/soledad/common/backend.py
+++ b/common/src/leap/soledad/common/backend.py
@@ -381,6 +381,8 @@ class SoledadBackend(CommonBackend):
synchronized with the replica, this is (0, '').
:rtype: (int, str)
"""
+ if other_replica_uid in self.cache:
+ return self.cache[other_replica_uid]
return self._database.get_replica_gen_and_trans_id(other_replica_uid)
def _set_replica_gen_and_trans_id(self, other_replica_uid,