mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Disable per user websocket connection limits in anon or debug mode
This rate limiting is only relevant in production scenarios.
This commit is contained in:
@@ -2099,7 +2099,8 @@ class WebSocketConnectionManager:
|
||||
user=user, slug__startswith=self.connection_slug_prefix
|
||||
).acount()
|
||||
|
||||
return active_connections < max_connections
|
||||
# Restrict max active connections per user in production
|
||||
return active_connections < max_connections or state.anonymous_mode or in_debug_mode()
|
||||
|
||||
async def register_connection(self, user: KhojUser, connection_id: str) -> None:
|
||||
"""Register a new WebSocket connection."""
|
||||
|
||||
Reference in New Issue
Block a user