Do not memoize get_key, but a separate method.
authorKali Kaneko <kali@leap.se>
Thu, 19 Dec 2013 02:36:20 +0000 (22:36 -0400)
committerKali Kaneko <kali@leap.se>
Thu, 19 Dec 2013 02:36:20 +0000 (22:36 -0400)
In this way we can choose which calls to get from cache
and we do not mess with the call from send_key

src/leap/keymanager/__init__.py

index 5b1d8d9..aa4e2e7 100644 (file)
@@ -252,6 +252,12 @@ class KeyManager(object):
         signal(proto.KEYMANAGER_DONE_UPLOADING_KEYS, self._address)
 
     @memoized_method
+    def get_key_from_cache(self, *args, **kwargs):
+        """
+        Public interface to `get_key`, that is memoized.
+        """
+        return self.get_key(*args, **kwargs)
+
     def get_key(self, address, ktype, private=False, fetch_remote=True):
         """
         Return a key of type C{ktype} bound to C{address}.