diff options
author | Mark Haines <mark.haines@matrix.org> | 2014-10-02 14:09:15 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2014-10-02 14:26:13 +0100 |
commit | 574377636ee4eafba50580fc4d7a1d0793774332 (patch) | |
tree | 2d8bcaafa39c69dbece39f0d5c28503ebf1efe36 /synapse/federation | |
parent | Merge branch 'master' into develop (diff) | |
download | synapse-574377636ee4eafba50580fc4d7a1d0793774332.tar.xz |
Add a keyword argument to get_json to avoid retrying on DNS failures. Rather than passing MatrixHttpClient.RETRY_DNS_LOOKUP_FAILURES as a fake query string parameter
Diffstat (limited to 'synapse/federation')
-rw-r--r-- | synapse/federation/replication.py | 7 | ||||
-rw-r--r-- | synapse/federation/transport.py | 5 |
2 files changed, 8 insertions, 4 deletions
diff --git a/synapse/federation/replication.py b/synapse/federation/replication.py index 96b82f00cb..5f96f79998 100644 --- a/synapse/federation/replication.py +++ b/synapse/federation/replication.py @@ -159,7 +159,8 @@ class ReplicationLayer(object): return defer.succeed(None) @log_function - def make_query(self, destination, query_type, args): + def make_query(self, destination, query_type, args, + retry_on_dns_fail=True): """Sends a federation Query to a remote homeserver of the given type and arguments. @@ -174,7 +175,9 @@ class ReplicationLayer(object): a Deferred which will eventually yield a JSON object from the response """ - return self.transport_layer.make_query(destination, query_type, args) + return self.transport_layer.make_query( + destination, query_type, args, retry_on_dns_fail=retry_on_dns_fail + ) @defer.inlineCallbacks @log_function diff --git a/synapse/federation/transport.py b/synapse/federation/transport.py index afc777ec9e..93296af204 100644 --- a/synapse/federation/transport.py +++ b/synapse/federation/transport.py @@ -193,13 +193,14 @@ class TransportLayer(object): @defer.inlineCallbacks @log_function - def make_query(self, destination, query_type, args): + def make_query(self, destination, query_type, args, retry_on_dns_fail): path = PREFIX + "/query/%s" % query_type response = yield self.client.get_json( destination=destination, path=path, - args=args + args=args, + retry_on_dns_fail=retry_on_dns_fail, ) defer.returnValue(response) |