diff options
author | Jonathan de Jong <jonathan@automatia.nl> | 2021-07-15 12:02:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-15 11:02:43 +0100 |
commit | bf72d10dbf506f5ea486d67094b6003947d38fb7 (patch) | |
tree | b7890a287d8fea6488797f6c2659082c4f7532db /synapse/replication/http/_base.py | |
parent | Allow providing credentials to `http_proxy` (#10360) (diff) | |
download | synapse-bf72d10dbf506f5ea486d67094b6003947d38fb7.tar.xz |
Use inline type hints in various other places (in `synapse/`) (#10380)
Diffstat (limited to 'synapse/replication/http/_base.py')
-rw-r--r-- | synapse/replication/http/_base.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/replication/http/_base.py b/synapse/replication/http/_base.py index f13a7c23b4..25589b0042 100644 --- a/synapse/replication/http/_base.py +++ b/synapse/replication/http/_base.py @@ -85,17 +85,17 @@ class ReplicationEndpoint(metaclass=abc.ABCMeta): is received. """ - NAME = abc.abstractproperty() # type: str # type: ignore - PATH_ARGS = abc.abstractproperty() # type: Tuple[str, ...] # type: ignore + NAME: str = abc.abstractproperty() # type: ignore + PATH_ARGS: Tuple[str, ...] = abc.abstractproperty() # type: ignore METHOD = "POST" CACHE = True RETRY_ON_TIMEOUT = True def __init__(self, hs: "HomeServer"): if self.CACHE: - self.response_cache = ResponseCache( + self.response_cache: ResponseCache[str] = ResponseCache( hs.get_clock(), "repl." + self.NAME, timeout_ms=30 * 60 * 1000 - ) # type: ResponseCache[str] + ) # We reserve `instance_name` as a parameter to sending requests, so we # assert here that sub classes don't try and use the name. @@ -232,7 +232,7 @@ class ReplicationEndpoint(metaclass=abc.ABCMeta): # have a good idea that the request has either succeeded or failed on # the master, and so whether we should clean up or not. while True: - headers = {} # type: Dict[bytes, List[bytes]] + headers: Dict[bytes, List[bytes]] = {} # Add an authorization header, if configured. if replication_secret: headers[b"Authorization"] = [b"Bearer " + replication_secret] |