Skip to content
Snippets Groups Projects
Unverified Commit 046a6513 authored by Shay's avatar Shay Committed by GitHub
Browse files

Don't process /send requests for users who have hit their ratelimit (#13134)

parent 8330fc99
No related branches found
No related tags found
No related merge requests found
Apply ratelimiting earlier in processing of /send request.
\ No newline at end of file
...@@ -903,6 +903,9 @@ class EventCreationHandler: ...@@ -903,6 +903,9 @@ class EventCreationHandler:
await self.clock.sleep(random.randint(1, 10)) await self.clock.sleep(random.randint(1, 10))
raise ShadowBanError() raise ShadowBanError()
if ratelimit:
await self.request_ratelimiter.ratelimit(requester, update=False)
# We limit the number of concurrent event sends in a room so that we # We limit the number of concurrent event sends in a room so that we
# don't fork the DAG too much. If we don't limit then we can end up in # don't fork the DAG too much. If we don't limit then we can end up in
# a situation where event persistence can't keep up, causing # a situation where event persistence can't keep up, causing
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment