mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-08 16:02:41 -04:00
Remove unnecessary reactor reference from _PerHostRatelimiter
(#14842)
Fix up #14812 to avoid introducing a reference to the reactor. Signed-off-by: Sean Quah <seanq@matrix.org>
This commit is contained in:
parent
7801fd74da
commit
a302d3ecf7
5 changed files with 7 additions and 14 deletions
|
@ -30,7 +30,7 @@ class FederationRateLimiterTestCase(TestCase):
|
|||
"""A simple test with the default values"""
|
||||
reactor, clock = get_clock()
|
||||
rc_config = build_rc_config()
|
||||
ratelimiter = FederationRateLimiter(reactor, clock, rc_config)
|
||||
ratelimiter = FederationRateLimiter(clock, rc_config)
|
||||
|
||||
with ratelimiter.ratelimit("testhost") as d1:
|
||||
# shouldn't block
|
||||
|
@ -40,7 +40,7 @@ class FederationRateLimiterTestCase(TestCase):
|
|||
"""Test what happens when we hit the concurrent limit"""
|
||||
reactor, clock = get_clock()
|
||||
rc_config = build_rc_config({"rc_federation": {"concurrent": 2}})
|
||||
ratelimiter = FederationRateLimiter(reactor, clock, rc_config)
|
||||
ratelimiter = FederationRateLimiter(clock, rc_config)
|
||||
|
||||
with ratelimiter.ratelimit("testhost") as d1:
|
||||
# shouldn't block
|
||||
|
@ -67,7 +67,7 @@ class FederationRateLimiterTestCase(TestCase):
|
|||
rc_config = build_rc_config(
|
||||
{"rc_federation": {"sleep_limit": 2, "sleep_delay": 500}}
|
||||
)
|
||||
ratelimiter = FederationRateLimiter(reactor, clock, rc_config)
|
||||
ratelimiter = FederationRateLimiter(clock, rc_config)
|
||||
|
||||
with ratelimiter.ratelimit("testhost") as d1:
|
||||
# shouldn't block
|
||||
|
@ -98,7 +98,7 @@ class FederationRateLimiterTestCase(TestCase):
|
|||
}
|
||||
}
|
||||
)
|
||||
ratelimiter = FederationRateLimiter(reactor, clock, rc_config)
|
||||
ratelimiter = FederationRateLimiter(clock, rc_config)
|
||||
|
||||
with ratelimiter.ratelimit("testhost") as d:
|
||||
# shouldn't block
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue