From bf9da27ca423d2ddbc54cb840332bccadbb3db34 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Wed, 13 Nov 2024 17:47:22 +1100 Subject: [PATCH] restreamer: refuse to load more than 2h of chat this hard locks up the server due to merge taking a very long time --- restreamer/restreamer/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/restreamer/restreamer/main.py b/restreamer/restreamer/main.py index f5173e4..3705584 100644 --- a/restreamer/restreamer/main.py +++ b/restreamer/restreamer/main.py @@ -573,6 +573,9 @@ def get_chat_messages(channel): if end <= start: return "End must be after start", 400 + if end - start > datetime.timedelta(hours=2): + return "Cannot request more than 2h of chat", 400 + hours_path = os.path.join(app.static_folder, channel, "chat") # This process below may fail if a batch is deleted out from underneath us.