summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-10-19 14:21:28 +0100
committerErik Johnston <erik@matrix.org>2016-10-19 14:21:28 +0100
commitf2f74ffce6e77234dad571b61b70e59a7534a681 (patch)
treed45153075163a18870f26d896c18e3b4119760ae
parentCheck whether to ratelimit sooner to avoid work (diff)
downloadsynapse-f2f74ffce6e77234dad571b61b70e59a7534a681.tar.xz
Comment
Diffstat (limited to '')
-rw-r--r--synapse/handlers/message.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index a94a514338..59eb26beaf 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -239,6 +239,9 @@ class MessageHandler(BaseHandler):
                 "Tried to send member event through non-member codepath"
             )
 
+        # We check here if we are currently being rate limited, so that we
+        # don't do unnecessary work. We check again just before we actually
+        # send the event.
         time_now = self.clock.time()
         allowed, time_allowed = self.ratelimiter.send_message(
             event.sender, time_now,