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