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": {