mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-08 05:54:59 -04:00
Run Black. (#5482)
This commit is contained in:
parent
7dcf984075
commit
32e7c9e7f2
376 changed files with 9142 additions and 10388 deletions
|
@ -83,8 +83,7 @@ class ReplicationEndpoint(object):
|
|||
def __init__(self, hs):
|
||||
if self.CACHE:
|
||||
self.response_cache = ResponseCache(
|
||||
hs, "repl." + self.NAME,
|
||||
timeout_ms=30 * 60 * 1000,
|
||||
hs, "repl." + self.NAME, timeout_ms=30 * 60 * 1000
|
||||
)
|
||||
|
||||
assert self.METHOD in ("PUT", "POST", "GET")
|
||||
|
@ -134,8 +133,7 @@ class ReplicationEndpoint(object):
|
|||
data = yield cls._serialize_payload(**kwargs)
|
||||
|
||||
url_args = [
|
||||
urllib.parse.quote(kwargs[name], safe='')
|
||||
for name in cls.PATH_ARGS
|
||||
urllib.parse.quote(kwargs[name], safe="") for name in cls.PATH_ARGS
|
||||
]
|
||||
|
||||
if cls.CACHE:
|
||||
|
@ -156,7 +154,10 @@ class ReplicationEndpoint(object):
|
|||
)
|
||||
|
||||
uri = "http://%s:%s/_synapse/replication/%s/%s" % (
|
||||
host, port, cls.NAME, "/".join(url_args)
|
||||
host,
|
||||
port,
|
||||
cls.NAME,
|
||||
"/".join(url_args),
|
||||
)
|
||||
|
||||
try:
|
||||
|
@ -202,10 +203,7 @@ class ReplicationEndpoint(object):
|
|||
url_args.append("txn_id")
|
||||
|
||||
args = "/".join("(?P<%s>[^/]+)" % (arg,) for arg in url_args)
|
||||
pattern = re.compile("^/_synapse/replication/%s/%s$" % (
|
||||
self.NAME,
|
||||
args
|
||||
))
|
||||
pattern = re.compile("^/_synapse/replication/%s/%s$" % (self.NAME, args))
|
||||
|
||||
http_server.register_paths(method, [pattern], handler)
|
||||
|
||||
|
@ -219,8 +217,4 @@ class ReplicationEndpoint(object):
|
|||
|
||||
assert self.CACHE
|
||||
|
||||
return self.response_cache.wrap(
|
||||
txn_id,
|
||||
self._handle_request,
|
||||
request, **kwargs
|
||||
)
|
||||
return self.response_cache.wrap(txn_id, self._handle_request, request, **kwargs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue