summary refs log tree commit diff
path: root/docs/modules
diff options
context:
space:
mode:
authorHugh Nimmo-Smith <hughns@users.noreply.github.com>2025-06-06 11:48:49 +0100
committerGitHub <noreply@github.com>2025-06-06 10:48:49 +0000
commit82189cbde45225d6c8793018343f265894ac8e23 (patch)
treef2b7bdf0b126b1717cd524ee35975c3b9a8db5a9 /docs/modules
parentDistinguish all vs local events being persisted in the "Event Send Time Quant... (diff)
downloadsynapse-82189cbde45225d6c8793018343f265894ac8e23.tar.xz
Export RatelimitOverride from ModuleApi (#18513)
Diffstat (limited to 'docs/modules')
-rw-r--r--docs/modules/ratelimit_callbacks.md7
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/modules/ratelimit_callbacks.md b/docs/modules/ratelimit_callbacks.md

index bf923c045e..3386220e37 100644 --- a/docs/modules/ratelimit_callbacks.md +++ b/docs/modules/ratelimit_callbacks.md
@@ -11,7 +11,7 @@ The available ratelimit callbacks are: _First introduced in Synapse v1.132.0_ ```python -async def get_ratelimit_override_for_user(user: str, limiter_name: str) -> Optional[RatelimitOverride] +async def get_ratelimit_override_for_user(user: str, limiter_name: str) -> Optional[synapse.module_api.RatelimitOverride] ``` Called when constructing a ratelimiter of a particular type for a user. The module can @@ -26,6 +26,11 @@ The limiters that are currently supported are: - `rc_invites.per_user` - `rc_invites.per_issuer` +The `RatelimitOverride` return type has the following fields: + +- `per_second: float`. The number of actions that can be performed in a second. `0.0` means that ratelimiting is disabled. +- `burst_count: int`. The number of actions that can be performed before being limited. + If multiple modules implement this callback, they will be considered in order. If a callback returns `None`, Synapse falls through to the next one. The value of the first callback that does not return `None` will be used. If this happens, Synapse will not call