mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-08 17:32:13 -04:00
Add type hints to expiring cache. (#9730)
This commit is contained in:
parent
024f121b74
commit
44bb881096
8 changed files with 65 additions and 54 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue