mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 01:14:48 -04:00
Add missing type hints to synapse.api. (#11109)
* Convert UserPresenceState to attrs. * Remove args/kwargs from error classes and explicitly pass msg/errorcode.
This commit is contained in:
parent
cc33d9eee2
commit
3ab55d43bd
10 changed files with 84 additions and 99 deletions
|
@ -161,7 +161,7 @@ class Ratelimiter:
|
|||
|
||||
return allowed, time_allowed
|
||||
|
||||
def _prune_message_counts(self, time_now_s: float):
|
||||
def _prune_message_counts(self, time_now_s: float) -> None:
|
||||
"""Remove message count entries that have not exceeded their defined
|
||||
rate_hz limit
|
||||
|
||||
|
@ -190,7 +190,7 @@ class Ratelimiter:
|
|||
update: bool = True,
|
||||
n_actions: int = 1,
|
||||
_time_now_s: Optional[float] = None,
|
||||
):
|
||||
) -> None:
|
||||
"""Checks if an action can be performed. If not, raises a LimitExceededError
|
||||
|
||||
Checks if the user has ratelimiting disabled in the database by looking
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue