summary refs log tree commit diff
path: root/synapse/push
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2015-12-02 12:56:23 +0000
committerMark Haines <mjark@negativecurvature.net>2015-12-02 12:56:23 +0000
commit5dc09e82c49c66f1b921dbfe54d68ab04bf97bbb (patch)
tree716b8ae4227d92e822b012f7b69d89f03ec11891 /synapse/push
parentMerge pull request #411 from matrix-org/default_dont_notify (diff)
parentReuse a single http client, rather than creating new ones (diff)
downloadsynapse-5dc09e82c49c66f1b921dbfe54d68ab04bf97bbb.tar.xz
Merge pull request #413 from matrix-org/markjh/reuse_http_client
Reuse a single http client, rather than creating new ones
Diffstat (limited to 'synapse/push')
-rw-r--r--synapse/push/httppusher.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/synapse/push/httppusher.py b/synapse/push/httppusher.py
index a02fed57b4..5160775e59 100644
--- a/synapse/push/httppusher.py
+++ b/synapse/push/httppusher.py
@@ -14,7 +14,6 @@
 # limitations under the License.
 
 from synapse.push import Pusher, PusherConfigException
-from synapse.http.client import SimpleHttpClient
 
 from twisted.internet import defer
 
@@ -46,7 +45,7 @@ class HttpPusher(Pusher):
                 "'url' required in data for HTTP pusher"
             )
         self.url = data['url']
-        self.httpCli = SimpleHttpClient(self.hs)
+        self.http_client = _hs.get_simple_http_client()
         self.data_minus_url = {}
         self.data_minus_url.update(self.data)
         del self.data_minus_url['url']
@@ -107,7 +106,7 @@ class HttpPusher(Pusher):
         if not notification_dict:
             defer.returnValue([])
         try:
-            resp = yield self.httpCli.post_json_get_json(self.url, notification_dict)
+            resp = yield self.http_client.post_json_get_json(self.url, notification_dict)
         except:
             logger.warn("Failed to push %s ", self.url)
             defer.returnValue(False)
@@ -138,7 +137,7 @@ class HttpPusher(Pusher):
             }
         }
         try:
-            resp = yield self.httpCli.post_json_get_json(self.url, d)
+            resp = yield self.http_client.post_json_get_json(self.url, d)
         except:
             logger.exception("Failed to push %s ", self.url)
             defer.returnValue(False)