summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2022-07-08 17:23:41 +0100
committerDavid Robertson <davidr@element.io>2022-07-08 17:23:41 +0100
commitdcb16831e87e519a1b37e904a0393a29bc1b8dcb (patch)
treecf9b14ecb272dfb3f1088ce2d0bcf26a9a10d24d
parentChangelog (diff)
downloadsynapse-dcb16831e87e519a1b37e904a0393a29bc1b8dcb.tar.xz
Move comment translating between bucket terminology
-rw-r--r--synapse/api/ratelimiting.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/api/ratelimiting.py b/synapse/api/ratelimiting.py
index 92c2f3b42a..930e96369d 100644
--- a/synapse/api/ratelimiting.py
+++ b/synapse/api/ratelimiting.py
@@ -27,6 +27,9 @@ class Ratelimiter:
     """
     Ratelimit actions marked by arbitrary keys.
 
+    (Note that the source code speaks of "actions" and "burst_count" rather than
+    "tokens" and a "bucket_size".)
+
     This is a "leaky bucket as a meter". For each key to be tracked there is a bucket
     containing some number 0 <= T <= `burst_count` of tokens corresponding to previously
     permitted requests for that key. Each bucket starts empty, and gradually leaks
@@ -51,9 +54,6 @@ class Ratelimiter:
     since this time point, and use that to decide if we should accept or reject the
     request.
 
-    Note that the source code speaks of "actions" and "burst_count" rather than "tokens"
-    and a "bucket_size".
-
     Args:
         clock: A homeserver clock, for retrieving the current time
         rate_hz: The long term number of actions that can be performed in a second.