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 cfd4591 commit cbb0453
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/knot_resolver/datamodel/rate_limiting_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class RateLimitingSchema(ConfigSchema):
dry_run: bool = False

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

0 comments on commit cbb0453

Please sign in to comment.