From 3867f668b15eded035d72f8027d36daf41e820e8 Mon Sep 17 00:00:00 2001 From: MattBild <34771705+mattbild@users.noreply.github.com> Date: Fri, 22 Sep 2023 16:46:14 +0200 Subject: [PATCH] =?UTF-8?q?[DONE]=20live=20event=20-=20export=20valeur=20v?= =?UTF-8?q?ers=20conf=20=20+=20cast=20propri=C3=A9t=C3=A9=20(#959)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * max attempt * export param dans fichier de config --- pod/live/utils.py | 6 ++++-- pod/live/views.py | 2 +- pod/main/configuration.json | 13 +++++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/pod/live/utils.py b/pod/live/utils.py index 5fb5503d38..7fd15504d5 100644 --- a/pod/live/utils.py +++ b/pod/live/utils.py @@ -25,6 +25,8 @@ DEBUG = getattr(settings, "DEBUG", True) +EVENT_CHECK_MAX_ATTEMPT = getattr(settings, "EVENT_CHECK_MAX_ATTEMPT", 10) + logger = logging.getLogger(__name__) @@ -188,7 +190,7 @@ def get_event_id_and_broadcaster_id(request): return event_id, broadcaster_id -def check_size_not_changing(resource_path, max_attempt=6): +def check_size_not_changing(resource_path, max_attempt=EVENT_CHECK_MAX_ATTEMPT): """ Checks if the size of a resource remains unchanged over a specified number of attempts. Args: @@ -220,7 +222,7 @@ def check_size_not_changing(resource_path, max_attempt=6): size_match = True -def check_exists(resource_path, is_dir, max_attempt=6): +def check_exists(resource_path, is_dir, max_attempt=EVENT_CHECK_MAX_ATTEMPT): """ Checks whether a file or directory exists. Args: diff --git a/pod/live/views.py b/pod/live/views.py index 3fd202103f..a7a8327f4e 100644 --- a/pod/live/views.py +++ b/pod/live/views.py @@ -1022,7 +1022,7 @@ def create_video(event_id, current_file, segment_number): except Exception as exc: return JsonResponse( status=500, - data={"success": False, "error": exc}, + data={"success": False, "error": str(exc)}, ) segment = "(" + segment_number + ")" if segment_number else "" diff --git a/pod/main/configuration.json b/pod/main/configuration.json index d1af4d3ecd..85453986ef 100644 --- a/pod/main/configuration.json +++ b/pod/main/configuration.json @@ -1031,6 +1031,19 @@ "pod_version_end": "", "pod_version_init": "3.1" }, + "EVENT_CHECK_MAX_ATTEMPT": { + "default_value": 10, + "description": { + "en": [ + "" + ], + "fr": [ + "Nombre de tentatives maximum pour vérifier la présence / taille d'un fichier sur le filesystem" + ] + }, + "pod_version_end": "", + "pod_version_init": "3.4" + }, "HEARTBEAT_DELAY": { "default_value": 45, "description": {