From 8de0564fefeac0b3ed817536a081e979068686a9 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Sat, 10 Jan 2026 18:28:00 +0800 Subject: [PATCH] =?UTF-8?q?feat(biz):=20=E6=9B=B4=E6=96=B0FFmpeg=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=90=AF=E5=8A=A8=E5=8A=9F=E8=83=BD=E4=BB=A5=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E5=B7=A5=E4=BD=9C=E7=BA=BF=E7=A8=8B=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改start_ffmpeg_task函数参数max_workers默认值为None - 添加环境变量FFMPEG_MAX_WORKERS读取逻辑 - 当max_workers为None时从环境变量获取默认值,否则使用传入值 - 保持原有tracer和任务分析功能不变 --- biz/ffmpeg.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/biz/ffmpeg.py b/biz/ffmpeg.py index 13ad6e3..5b7dcd9 100644 --- a/biz/ffmpeg.py +++ b/biz/ffmpeg.py @@ -129,7 +129,9 @@ def check_placeholder_exist_with_count(placeholder_id, task_params, required_cou return False -def start_ffmpeg_task(ffmpeg_task, max_workers=4): +def start_ffmpeg_task(ffmpeg_task, max_workers=None): + if max_workers is None: + max_workers = int(os.environ.get("FFMPEG_MAX_WORKERS", 4)) tracer = get_tracer(__name__) with tracer.start_as_current_span("start_ffmpeg_task") as span: sub_tasks = list(ffmpeg_task.analyze_input_render_tasks())