mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 05:05:05 -04:00
Remove the deprecated BaseHandler. (#11005)
The shared ratelimit function was replaced with a dedicated RequestRatelimiter class (accessible from the HomeServer object). Other properties were copied to each sub-class that inherited from BaseHandler.
This commit is contained in:
parent
49a683d871
commit
eb9ddc8c2e
24 changed files with 166 additions and 215 deletions
|
@ -39,7 +39,7 @@ from twisted.web.resource import IResource
|
|||
|
||||
from synapse.api.auth import Auth
|
||||
from synapse.api.filtering import Filtering
|
||||
from synapse.api.ratelimiting import Ratelimiter
|
||||
from synapse.api.ratelimiting import Ratelimiter, RequestRatelimiter
|
||||
from synapse.appservice.api import ApplicationServiceApi
|
||||
from synapse.appservice.scheduler import ApplicationServiceScheduler
|
||||
from synapse.config.homeserver import HomeServerConfig
|
||||
|
@ -816,3 +816,12 @@ class HomeServer(metaclass=abc.ABCMeta):
|
|||
def should_send_federation(self) -> bool:
|
||||
"Should this server be sending federation traffic directly?"
|
||||
return self.config.worker.send_federation
|
||||
|
||||
@cache_in_self
|
||||
def get_request_ratelimiter(self) -> RequestRatelimiter:
|
||||
return RequestRatelimiter(
|
||||
self.get_datastore(),
|
||||
self.get_clock(),
|
||||
self.config.ratelimiting.rc_message,
|
||||
self.config.ratelimiting.rc_admin_redaction,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue