mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 05:39:12 +00:00
Disable rate limiting if billing is not enabled
This commit is contained in:
@@ -788,6 +788,10 @@ class ApiUserRateLimiter:
|
|||||||
self.slug = slug
|
self.slug = slug
|
||||||
|
|
||||||
def __call__(self, request: Request):
|
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.
|
# Rate limiting is disabled if user unauthenticated.
|
||||||
# Other systems handle authentication
|
# Other systems handle authentication
|
||||||
if not request.user.is_authenticated:
|
if not request.user.is_authenticated:
|
||||||
|
|||||||
Reference in New Issue
Block a user