diff options
author | H. Shay <hillerys@element.io> | 2022-06-29 14:11:51 -0700 |
---|---|---|
committer | H. Shay <hillerys@element.io> | 2022-06-29 14:11:51 -0700 |
commit | 44b3c05f74c41c84f6d4ada34fad76b1c48a30a8 (patch) | |
tree | ee36fa7d982c66b6c5e10755b6ca2e69972d6fbc | |
parent | Implement MSC3827: Filtering of `/publicRooms` by room type (#13031) (diff) | |
download | synapse-44b3c05f74c41c84f6d4ada34fad76b1c48a30a8.tar.xz |
apply ratelimit earlier in /send request process
Diffstat (limited to '')
-rw-r--r-- | synapse/handlers/message.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py index 189f52fe5a..c6b40a5b7a 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -903,6 +903,9 @@ class EventCreationHandler: await self.clock.sleep(random.randint(1, 10)) 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 # 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 |