summary refs log tree commit diff
path: root/synapse/http/client.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-10-02 14:09:15 +0100
committerMark Haines <mark.haines@matrix.org>2014-10-02 14:26:13 +0100
commit574377636ee4eafba50580fc4d7a1d0793774332 (patch)
tree2d8bcaafa39c69dbece39f0d5c28503ebf1efe36 /synapse/http/client.py
parentMerge branch 'master' into develop (diff)
downloadsynapse-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/http/client.py')
-rw-r--r--synapse/http/client.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/synapse/http/client.py b/synapse/http/client.py
index e02cce5642..57b49355f2 100644
--- a/synapse/http/client.py
+++ b/synapse/http/client.py
@@ -183,7 +183,7 @@ class MatrixHttpClient(BaseHttpClient):
         defer.returnValue((response.code, body))
 
     @defer.inlineCallbacks
-    def get_json(self, destination, path, args={}):
+    def get_json(self, destination, path, args={}, retry_on_dns_fail=True):
         """ Get's some json from the given host homeserver and path
 
         Args:
@@ -203,13 +203,6 @@ class MatrixHttpClient(BaseHttpClient):
         """
         logger.debug("get_json args: %s", args)
 
-        retry_on_dns_fail = True
-        if HttpClient.RETRY_DNS_LOOKUP_FAILURES in args:
-            # FIXME: This isn't ideal, but the interface exposed in get_json
-            # isn't comprehensive enough to give caller's any control over
-            # their connection mechanics.
-            retry_on_dns_fail = args.pop(HttpClient.RETRY_DNS_LOOKUP_FAILURES)
-
         query_bytes = urllib.urlencode(args, True)
         logger.debug("Query bytes: %s Retry DNS: %s", args, retry_on_dns_fail)