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:
Debanjum
2025-07-22 18:45:34 -05:00
parent 48e21d9f0f
commit bf9a9c7283

View File

@@ -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."""