mirror of
https://github.com/khoj-ai/khoj.git
synced 2025-02-17 08:04:21 +00:00
Disable rate limiting if billing is not enabled
This commit is contained in:
parent
45e725ac9c
commit
7e4a61f2ac
1 changed files with 4 additions and 0 deletions
|
@ -788,6 +788,10 @@ class ApiUserRateLimiter:
|
|||
self.slug = slug
|
||||
|
||||
def __call__(self, request: Request):
|
||||
# Rate limiting disabled if billing is disabled
|
||||
if state.billing_enabled is False:
|
||||
return
|
||||
|
||||
# Rate limiting is disabled if user unauthenticated.
|
||||
# Other systems handle authentication
|
||||
if not request.user.is_authenticated:
|
||||
|
|
Loading…
Add table
Reference in a new issue