diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2021-03-29 12:15:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-29 12:15:33 -0400 |
commit | 01dd90b0f08d1ffb36eb24282edc5db62a21170f (patch) | |
tree | e1b2983708614d3be8f70d79f480dae81d591c97 /synapse/http | |
parent | Clarify that register_new_matrix_user is present also when installed via non-... (diff) | |
download | synapse-01dd90b0f08d1ffb36eb24282edc5db62a21170f.tar.xz |
Add type hints to DictionaryCache and TTLCache. (#9442)
Diffstat (limited to 'synapse/http')
-rw-r--r-- | synapse/http/federation/well_known_resolver.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/synapse/http/federation/well_known_resolver.py b/synapse/http/federation/well_known_resolver.py index ecd63e6596..ce4079f15c 100644 --- a/synapse/http/federation/well_known_resolver.py +++ b/synapse/http/federation/well_known_resolver.py @@ -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) |