diff --git a/django_app/redbox_app/redbox_core/consumers.py b/django_app/redbox_app/redbox_core/consumers.py index bf1d3316c..e31607d3d 100644 --- a/django_app/redbox_app/redbox_core/consumers.py +++ b/django_app/redbox_app/redbox_core/consumers.py @@ -25,6 +25,7 @@ ChatMessage, File, ) +from redbox.models.settings import get_settings from redbox_app.redbox_core.ratelimit import UserRateLimiter from redbox_app.redbox_core.utils import sanitise_string @@ -48,7 +49,7 @@ class ChatConsumer(AsyncWebsocketConsumer): full_reply: ClassVar = [] route = None redbox = Redbox(debug=settings.DEBUG) - user_ratelimiter: UserRateLimiter = UserRateLimiter() + user_ratelimiter: UserRateLimiter = UserRateLimiter(initial_user_credits=get_settings().user_token_rate_limit_second*60) async def receive(self, text_data=None, bytes_data=None): """Receive & respond to message from browser websocket.""" diff --git a/django_app/redbox_app/redbox_core/ratelimit.py b/django_app/redbox_app/redbox_core/ratelimit.py index d5a3daea2..5073060b8 100644 --- a/django_app/redbox_app/redbox_core/ratelimit.py +++ b/django_app/redbox_app/redbox_core/ratelimit.py @@ -23,7 +23,7 @@ class UserRateLimiter(): def __init__( self, - initial_user_credits = 350_000 + initial_user_credits = 360_000 ) -> None: self.initial_user_credits = initial_user_credits