diff options
author | Amber Brown <hawkowl@atleastfornow.net> | 2019-05-15 12:06:04 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-15 12:06:04 -0500 |
commit | f1e5b413886ba4d9d0a16b028dba89c4a5cb56ac (patch) | |
tree | 590ed475c14dc2e17007a240ab3a0e3ceb9928d7 /tests/utils.py | |
parent | Drop support for v2_alpha API prefix (#5190) (diff) | |
download | synapse-f1e5b413886ba4d9d0a16b028dba89c4a5cb56ac.tar.xz |
Make all the rate limiting options more consistent (#5181)
Diffstat (limited to '')
-rw-r--r-- | tests/utils.py | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/tests/utils.py b/tests/utils.py index f38533a0c7..200c1ceabe 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -134,10 +134,6 @@ def default_config(name, parse=False): "email_enable_notifs": False, "block_non_admin_invites": False, "federation_domain_whitelist": None, - "federation_rc_reject_limit": 10, - "federation_rc_sleep_limit": 10, - "federation_rc_sleep_delay": 100, - "federation_rc_concurrent": 10, "filter_timeline_limit": 5000, "user_directory_search_all_users": False, "user_consent_server_notice_content": None, @@ -156,8 +152,13 @@ def default_config(name, parse=False): "mau_stats_only": False, "mau_limits_reserved_threepids": [], "admin_contact": None, - "rc_messages_per_second": 10000, - "rc_message_burst_count": 10000, + "rc_federation": { + "reject_limit": 10, + "sleep_limit": 10, + "sleep_delay": 10, + "concurrent": 10, + }, + "rc_message": {"per_second": 10000, "burst_count": 10000}, "rc_registration": {"per_second": 10000, "burst_count": 10000}, "rc_login": { "address": {"per_second": 10000, "burst_count": 10000}, @@ -375,12 +376,7 @@ def register_federation_servlets(hs, resource): resource=resource, authenticator=federation_server.Authenticator(hs), ratelimiter=FederationRateLimiter( - hs.get_clock(), - window_size=hs.config.federation_rc_window_size, - sleep_limit=hs.config.federation_rc_sleep_limit, - sleep_msec=hs.config.federation_rc_sleep_delay, - reject_limit=hs.config.federation_rc_reject_limit, - concurrent_requests=hs.config.federation_rc_concurrent, + hs.get_clock(), config=hs.config.rc_federation ), ) |