Remove duplicate config defaults in ratelimit.py
This commit is contained in:
@@ -85,11 +85,11 @@ class GoodLimiter(BaseLimiter):
|
||||
Args:
|
||||
config: Full configuration dictionary.
|
||||
"""
|
||||
rl = config.get("rate_limit", {})
|
||||
rl = config["rate_limit"]
|
||||
super().__init__(
|
||||
rl.get("good_window_seconds", 60),
|
||||
rl.get("good_max_requests", 30),
|
||||
rl.get("enabled", False),
|
||||
rl["good_window_seconds"],
|
||||
rl["good_max_requests"],
|
||||
rl["enabled"],
|
||||
False,
|
||||
)
|
||||
|
||||
@@ -104,10 +104,10 @@ class BadLimiter(BaseLimiter):
|
||||
Args:
|
||||
config: Full configuration dictionary.
|
||||
"""
|
||||
rl = config.get("rate_limit", {})
|
||||
rl = config["rate_limit"]
|
||||
super().__init__(
|
||||
rl.get("bad_window_seconds", 60),
|
||||
rl.get("bad_max_requests", 5),
|
||||
rl.get("enabled", False),
|
||||
rl["bad_window_seconds"],
|
||||
rl["bad_max_requests"],
|
||||
rl["enabled"],
|
||||
True,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user