summary refs log tree commit diff
path: root/synapse/state/__init__.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2021-04-06 08:58:18 -0400
committerGitHub <noreply@github.com>2021-04-06 08:58:18 -0400
commit44bb881096d7ad4d730e2dc31e0094c0324e0970 (patch)
treee5fdb161168dba08ec4f800ed5f0d44eb8a552cd /synapse/state/__init__.py
parentFix reported bugbear: too broad exception assertion (#9753) (diff)
downloadsynapse-44bb881096d7ad4d730e2dc31e0094c0324e0970.tar.xz
Add type hints to expiring cache. (#9730)
Diffstat (limited to 'synapse/state/__init__.py')
-rw-r--r--synapse/state/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/state/__init__.py b/synapse/state/__init__.py
index c3d6e80c49..c0f79ffdc8 100644
--- a/synapse/state/__init__.py
+++ b/synapse/state/__init__.py
@@ -22,6 +22,7 @@ from typing import (
     Callable,
     DefaultDict,
     Dict,
+    FrozenSet,
     Iterable,
     List,
     Optional,
@@ -515,7 +516,7 @@ class StateResolutionHandler:
             expiry_ms=EVICTION_TIMEOUT_SECONDS * 1000,
             iterable=True,
             reset_expiry_on_get=True,
-        )
+        )  # type: ExpiringCache[FrozenSet[int], _StateCacheEntry]
 
         #
         # stuff for tracking time spent on state-res by room
@@ -536,7 +537,7 @@ class StateResolutionHandler:
         state_groups_ids: Dict[int, StateMap[str]],
         event_map: Optional[Dict[str, EventBase]],
         state_res_store: "StateResolutionStore",
-    ):
+    ) -> _StateCacheEntry:
         """Resolves conflicts between a set of state groups
 
         Always generates a new state group (unless we hit the cache), so should