Set daily limit for unsubsribed users to 5 in websocket API

This commit is contained in:
sabaimran 2024-04-08 21:16:48 +05:30
parent 27815d982c
commit 1c229dad91

View file

@ -313,9 +313,9 @@ async def websocket_endpoint(
user, client_application=websocket.user.client_app, conversation_id=conversation_id user, client_application=websocket.user.client_app, conversation_id=conversation_id
) )
hourly_limiter = ApiUserRateLimiter(requests=1, subscribed_requests=60, window=60, slug="chat_minute") hourly_limiter = ApiUserRateLimiter(requests=5, subscribed_requests=60, window=60, slug="chat_minute")
daily_limiter = ApiUserRateLimiter(requests=1, subscribed_requests=600, window=60 * 60 * 24, slug="chat_day") daily_limiter = ApiUserRateLimiter(requests=5, subscribed_requests=600, window=60 * 60 * 24, slug="chat_day")
await is_ready_to_chat(user) await is_ready_to_chat(user)