Skip to content

Commit

Permalink
fixup! rate-limiting config: use more precise types
Browse files Browse the repository at this point in the history
  • Loading branch information
vcunat committed Nov 6, 2024
1 parent 0a22caa commit cfd4591
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/knot_resolver/datamodel/rate_limiting_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class RateLimitingSchema(ConfigSchema):

def _validate(self) -> None:
max_instant_limit = 2 ^ 32 // 768 - 1
if int(self.instant_limit) <= max_instant_limit:
if not int(self.instant_limit) <= max_instant_limit:
raise ValueError(f"'instant-limit' has to be in range 1..{max_instant_limit}")
if int(self.rate_limit) <= 1000 * int(self.instant_limit):
if not int(self.rate_limit) <= 1000 * int(self.instant_limit):
raise ValueError("'rate-limit' has to be in range 1..(1000 * instant-limit)")

0 comments on commit cfd4591

Please sign in to comment.