diff options
author | Erik Johnston <erik@matrix.org> | 2019-10-29 13:00:51 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2019-10-29 13:00:51 +0000 |
commit | e577a4b2ad01233ed70b3ab0a9e52aab42e88231 (patch) | |
tree | cff16626eb9135baffe1874576d4145b2664b883 /synapse/replication/http/send_event.py | |
parent | Merge pull request #6263 from matrix-org/erikj/caches_return_deferreds (diff) | |
download | synapse-e577a4b2ad01233ed70b3ab0a9e52aab42e88231.tar.xz |
Port replication http server endpoints to async/await
Diffstat (limited to 'synapse/replication/http/send_event.py')
-rw-r--r-- | synapse/replication/http/send_event.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/synapse/replication/http/send_event.py b/synapse/replication/http/send_event.py index adb9b2f7f4..9bafd60b14 100644 --- a/synapse/replication/http/send_event.py +++ b/synapse/replication/http/send_event.py @@ -87,8 +87,7 @@ class ReplicationSendEventRestServlet(ReplicationEndpoint): return payload - @defer.inlineCallbacks - def _handle_request(self, request, event_id): + async def _handle_request(self, request, event_id): with Measure(self.clock, "repl_send_event_parse"): content = parse_json_object_from_request(request) @@ -101,7 +100,7 @@ class ReplicationSendEventRestServlet(ReplicationEndpoint): event = EventType(event_dict, internal_metadata, rejected_reason) requester = Requester.deserialize(self.store, content["requester"]) - context = yield EventContext.deserialize(self.store, content["context"]) + context = EventContext.deserialize(self.store, content["context"]) ratelimit = content["ratelimit"] extra_users = [UserID.from_string(u) for u in content["extra_users"]] @@ -113,7 +112,7 @@ class ReplicationSendEventRestServlet(ReplicationEndpoint): "Got event to send with ID: %s into room: %s", event.event_id, event.room_id ) - yield self.event_creation_handler.persist_and_notify_client_event( + await self.event_creation_handler.persist_and_notify_client_event( requester, event, context, ratelimit=ratelimit, extra_users=extra_users ) |