mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 19:54:53 -04:00
Add type hints to DictionaryCache and TTLCache. (#9442)
This commit is contained in:
parent
7dcf3fd221
commit
01dd90b0f0
7 changed files with 96 additions and 67 deletions
|
@ -71,8 +71,10 @@ WELL_KNOWN_RETRY_ATTEMPTS = 3
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
_well_known_cache = TTLCache("well-known")
|
||||
_had_valid_well_known_cache = TTLCache("had-valid-well-known")
|
||||
_well_known_cache = TTLCache("well-known") # type: TTLCache[bytes, Optional[bytes]]
|
||||
_had_valid_well_known_cache = TTLCache(
|
||||
"had-valid-well-known"
|
||||
) # type: TTLCache[bytes, bool]
|
||||
|
||||
|
||||
@attr.s(slots=True, frozen=True)
|
||||
|
@ -88,8 +90,8 @@ class WellKnownResolver:
|
|||
reactor: IReactorTime,
|
||||
agent: IAgent,
|
||||
user_agent: bytes,
|
||||
well_known_cache: Optional[TTLCache] = None,
|
||||
had_well_known_cache: Optional[TTLCache] = None,
|
||||
well_known_cache: Optional[TTLCache[bytes, Optional[bytes]]] = None,
|
||||
had_well_known_cache: Optional[TTLCache[bytes, bool]] = None,
|
||||
):
|
||||
self._reactor = reactor
|
||||
self._clock = Clock(reactor)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue