summary refs log tree commit diff
path: root/synapse/replication/http/login.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-10-29 13:00:51 +0000
committerErik Johnston <erik@matrix.org>2019-10-29 13:00:51 +0000
commite577a4b2ad01233ed70b3ab0a9e52aab42e88231 (patch)
treecff16626eb9135baffe1874576d4145b2664b883 /synapse/replication/http/login.py
parentMerge pull request #6263 from matrix-org/erikj/caches_return_deferreds (diff)
downloadsynapse-e577a4b2ad01233ed70b3ab0a9e52aab42e88231.tar.xz
Port replication http server endpoints to async/await
Diffstat (limited to 'synapse/replication/http/login.py')
-rw-r--r--synapse/replication/http/login.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/synapse/replication/http/login.py b/synapse/replication/http/login.py
index 786f5232b2..798b9d3af5 100644
--- a/synapse/replication/http/login.py
+++ b/synapse/replication/http/login.py
@@ -15,8 +15,6 @@
 
 import logging
 
-from twisted.internet import defer
-
 from synapse.http.servlet import parse_json_object_from_request
 from synapse.replication.http._base import ReplicationEndpoint
 
@@ -52,15 +50,14 @@ class RegisterDeviceReplicationServlet(ReplicationEndpoint):
             "is_guest": is_guest,
         }
 
-    @defer.inlineCallbacks
-    def _handle_request(self, request, user_id):
+    async def _handle_request(self, request, user_id):
         content = parse_json_object_from_request(request)
 
         device_id = content["device_id"]
         initial_display_name = content["initial_display_name"]
         is_guest = content["is_guest"]
 
-        device_id, access_token = yield self.registration_handler.register_device(
+        device_id, access_token = await self.registration_handler.register_device(
             user_id, device_id, initial_display_name, is_guest
         )