diff --git a/protocol.py b/protocol.py index c0e94adf..6ad0b846 100644 --- a/protocol.py +++ b/protocol.py @@ -350,6 +350,7 @@ class Protocol: logger.info(f'No matching protocol found for {id} !') return None + @cached(LRUCache(20000), lock=Lock()) @staticmethod def for_handle(handle): """Returns the protocol for a given handle. diff --git a/tests/testutil.py b/tests/testutil.py index e1fcd216..e76c5517 100644 --- a/tests/testutil.py +++ b/tests/testutil.py @@ -264,6 +264,7 @@ class TestCase(unittest.TestCase, testutil.Asserts): did.resolve_web.cache.clear() ids.web_ap_base_domain.cache.clear() protocol.Protocol.for_id.cache.clear() + protocol.Protocol.for_handle.cache.clear() User.count_followers.cache.clear() for cls in ExplicitEnableFake, Fake, OtherFake: