mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 21:44:48 -04:00
Fix ratelimiting for federation /send
requests. (#8342)
c.f. #8295 for rationale
This commit is contained in:
parent
ad055ea4cc
commit
14b5b48a22
4 changed files with 54 additions and 17 deletions
|
@ -114,6 +114,7 @@ from synapse.streams.events import EventSources
|
|||
from synapse.types import DomainSpecificString
|
||||
from synapse.util import Clock
|
||||
from synapse.util.distributor import Distributor
|
||||
from synapse.util.ratelimitutils import FederationRateLimiter
|
||||
from synapse.util.stringutils import random_string
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -642,6 +643,10 @@ class HomeServer(metaclass=abc.ABCMeta):
|
|||
def get_replication_streams(self) -> Dict[str, Stream]:
|
||||
return {stream.NAME: stream(self) for stream in STREAMS_MAP.values()}
|
||||
|
||||
@cache_in_self
|
||||
def get_federation_ratelimiter(self) -> FederationRateLimiter:
|
||||
return FederationRateLimiter(self.clock, config=self.config.rc_federation)
|
||||
|
||||
async def remove_pusher(self, app_id: str, push_key: str, user_id: str):
|
||||
return await self.get_pusherpool().remove_pusher(app_id, push_key, user_id)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue