cancel recording after 20 attempts

This commit is contained in:
deflax 2024-01-12 22:43:06 +02:00
parent 39ab8c23d2
commit 4a9ae58740

View file

@ -162,7 +162,10 @@ def exec_recorder(stream_id, stream_hls_url):
req_counter += 1
if requests.get(stream_hls_url).status_code == 200:
logger_job.warning(f'{stream_hls_url} accessible after {req_counter} attempts.')
break
break
if req_counter == 20:
logger_job.error(f'Recording cancelled after {req_counter} attempts.')
return False
logger_job.warning(f'Starting recording job for {output_file}')
rechead = stream_id
ffmpeg = (