diff options
author | David Robertson <davidr@element.io> | 2023-08-30 00:39:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-30 00:39:39 +0100 |
commit | 62a1a9be52f4bc79b112f9841ddb3d03b8efccba (patch) | |
tree | 36a76a4b81b829f700f7c6edd36e009b688c9734 /synapse/handlers/room_summary.py | |
parent | Track currently syncing users by device for presence (#16172) (diff) | |
download | synapse-62a1a9be52f4bc79b112f9841ddb3d03b8efccba.tar.xz |
Describe which rate limiter was hit in logs (#16135)
Diffstat (limited to 'synapse/handlers/room_summary.py')
-rw-r--r-- | synapse/handlers/room_summary.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/handlers/room_summary.py b/synapse/handlers/room_summary.py index dad3e23470..dd559b4c45 100644 --- a/synapse/handlers/room_summary.py +++ b/synapse/handlers/room_summary.py @@ -35,6 +35,7 @@ from synapse.api.errors import ( UnsupportedRoomVersionError, ) from synapse.api.ratelimiting import Ratelimiter +from synapse.config.ratelimiting import RatelimitSettings from synapse.events import EventBase from synapse.types import JsonDict, Requester, StrCollection from synapse.util.caches.response_cache import ResponseCache @@ -94,7 +95,9 @@ class RoomSummaryHandler: self._server_name = hs.hostname self._federation_client = hs.get_federation_client() self._ratelimiter = Ratelimiter( - store=self._store, clock=hs.get_clock(), rate_hz=5, burst_count=10 + store=self._store, + clock=hs.get_clock(), + cfg=RatelimitSettings("<room summary>", per_second=5, burst_count=10), ) # If a user tries to fetch the same page multiple times in quick succession, |