diff options
author | Mark Haines <mark.haines@matrix.org> | 2014-09-02 17:57:04 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2014-09-02 17:57:04 +0100 |
commit | c7a7cdf7346c9268b1d4f483b31e1fdc39b6d7e0 (patch) | |
tree | 0981bb47e64f47f3a4e57b4010f5fcb4743824d0 /synapse/server.py | |
parent | Test ratelimiter (diff) | |
download | synapse-c7a7cdf7346c9268b1d4f483b31e1fdc39b6d7e0.tar.xz |
Add ratelimiting function to basehandler
Diffstat (limited to 'synapse/server.py')
-rw-r--r-- | synapse/server.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/server.py b/synapse/server.py index 3e72b2bcd5..35e311a47d 100644 --- a/synapse/server.py +++ b/synapse/server.py @@ -32,6 +32,7 @@ from synapse.util import Clock from synapse.util.distributor import Distributor from synapse.util.lockutils import LockManager from synapse.streams.events import EventSources +from synapse.api.ratelimiting import Ratelimiter class BaseHomeServer(object): @@ -73,6 +74,7 @@ class BaseHomeServer(object): 'resource_for_web_client', 'resource_for_content_repo', 'event_sources', + 'ratelimiter', ] def __init__(self, hostname, **kwargs): @@ -190,6 +192,9 @@ class HomeServer(BaseHomeServer): def build_event_sources(self): return EventSources(self) + def build_ratelimiter(self): + return Ratelimiter() + def register_servlets(self): """ Register all servlets associated with this HomeServer. """ |