Skip to content

Commit

Permalink
🐛 Fix rate limit increment in application.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mnixry committed Apr 23, 2024
1 parent 1f53c3a commit c06a872
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hibiapi/app/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ async def rate_limit_depend(request: Request):
except ValueError:
limit_key = f"rate_limit:fallback-{request.client.host}"

request_count = await cache.incr(limit_key) or 1
request_count = await cache.incr(limit_key)
if request_count <= 1:
await cache.expire(limit_key, timeout=RATE_LIMIT_INTERVAL)
elif request_count > RATE_LIMIT_MAX:
Expand Down

0 comments on commit c06a872

Please sign in to comment.