cache Protocol.for_handle

pull/1258/head
Ryan Barrett 2024-08-12 13:31:13 -07:00
rodzic e21dabe98d
commit 497136f1fc
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
2 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -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.

Wyświetl plik

@ -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: