summary refs log tree commit diff
path: root/synapse/handlers/_base.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-07-17 07:08:30 -0400
committerGitHub <noreply@github.com>2020-07-17 07:08:30 -0400
commit6fca1b3506e31e6864e1dc18046f1962813f14e2 (patch)
treeef15f4747dd7767e367c24589f1f0732fa943a91 /synapse/handlers/_base.py
parentAdd admin endpoint to get members in a room. (#7842) (diff)
downloadsynapse-6fca1b3506e31e6864e1dc18046f1962813f14e2.tar.xz
Convert _base, profile, and _receipts handlers to async/await (#7860)
Diffstat (limited to 'synapse/handlers/_base.py')
-rw-r--r--synapse/handlers/_base.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/synapse/handlers/_base.py b/synapse/handlers/_base.py
index 6a4944467a..ba2bf99800 100644
--- a/synapse/handlers/_base.py
+++ b/synapse/handlers/_base.py
@@ -15,8 +15,6 @@
 
 import logging
 
-from twisted.internet import defer
-
 import synapse.state
 import synapse.storage
 import synapse.types
@@ -66,8 +64,7 @@ class BaseHandler(object):
 
         self.event_builder_factory = hs.get_event_builder_factory()
 
-    @defer.inlineCallbacks
-    def ratelimit(self, requester, update=True, is_admin_redaction=False):
+    async def ratelimit(self, requester, update=True, is_admin_redaction=False):
         """Ratelimits requests.
 
         Args:
@@ -99,7 +96,7 @@ class BaseHandler(object):
         burst_count = self._rc_message.burst_count
 
         # Check if there is a per user override in the DB.
-        override = yield self.store.get_ratelimit_for_user(user_id)
+        override = await self.store.get_ratelimit_for_user(user_id)
         if override:
             # If overridden with a null Hz then ratelimiting has been entirely
             # disabled for the user