diff options
author | Erik Johnston <erik@matrix.org> | 2018-07-31 13:53:54 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2018-07-31 14:32:23 +0100 |
commit | 729b672823132f413800a10f5fa8cac1f9b99008 (patch) | |
tree | 869e93589966144124784b60a7326c17bb7b9c9d /synapse/handlers/message.py | |
parent | Add helper base class for generating new replication endpoints (diff) | |
download | synapse-729b672823132f413800a10f5fa8cac1f9b99008.tar.xz |
Use new helper base class for ReplicationSendEventRestServlet
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r-- | synapse/handlers/message.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py index 39d7724778..bcb093ba3e 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -30,7 +30,7 @@ from synapse.api.urls import ConsentURIBuilder from synapse.crypto.event_signing import add_hashes_and_signatures from synapse.events.utils import serialize_event from synapse.events.validator import EventValidator -from synapse.replication.http.send_event import send_event_to_master +from synapse.replication.http.send_event import ReplicationSendEventRestServlet from synapse.types import RoomAlias, UserID from synapse.util.async import Linearizer from synapse.util.frozenutils import frozendict_json_encoder @@ -171,7 +171,7 @@ class EventCreationHandler(object): self.notifier = hs.get_notifier() self.config = hs.config - self.http_client = hs.get_simple_http_client() + self.send_event_to_master = ReplicationSendEventRestServlet.make_client(hs) # This is only used to get at ratelimit function, and maybe_kick_guest_users self.base_handler = BaseHandler(hs) @@ -559,12 +559,9 @@ class EventCreationHandler(object): try: # If we're a worker we need to hit out to the master. if self.config.worker_app: - yield send_event_to_master( - clock=self.hs.get_clock(), + yield self.send_event_to_master( + event_id=event.event_id, store=self.store, - client=self.http_client, - host=self.config.worker_replication_host, - port=self.config.worker_replication_http_port, requester=requester, event=event, context=context, |