-
-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Labels
Description
Bug Description
The rate_limit field in the Settings config is evaluated at class definition time instead of runtime. Because it depends on rate_limit_max_requests and rate_limit_window, changes from environment variables are not reflected, resulting in incorrect rate limit values.
To Reproduce
- Set in
.env:
RATE_LIMIT_MAX_REQUESTS=10
RATE_LIMIT_WINDOW=120 - Start the backend.
- Log or print
settings.rate_limit.
Expected Behavior
rate_limit should dynamically reflect the current values.
Example: 10 requests per 120s
Actual Behavior
The value remains 30 requests per 60s (default) even after env changes.
Screenshots/Logs
INFO: Loaded rate limit: 30 requests per 60s
Expected: 10 requests per 120s
Environment
OS: Windows 11
Shell: PowerShell 5.1
Node.js: 18.17.0
Python: 3.11.x
Coderrr: 1.1.0
Additional Context
This happens because rate_limit is a static class attribute instead of a computed property.
Checklist
- I have searched for similar issues
- I have included all requested information
- I have verified
.env - I have tested the latest version
Reactions are currently unavailable