From 5e47ff186db38b1f610444f19ec57c838efbbf03 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Thu, 29 Oct 2015 16:56:24 -0300 Subject: [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. --- common/src/leap/soledad/common/backend.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common') 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, -- cgit v1.2.3