|
@@ -129,6 +129,7 @@ async def main(video_path, api_key, prompt, sample_data):
|
|
|
"""主函数,执行视频上传、缓存创建、问题生成"""
|
|
|
attempt = 0
|
|
|
max_attempts = 1
|
|
|
+ save_path = None
|
|
|
while attempt < max_attempts:
|
|
|
try:
|
|
|
# 初始化视频分析类
|
|
@@ -204,6 +205,9 @@ async def main(video_path, api_key, prompt, sample_data):
|
|
|
if attempt < max_attempts:
|
|
|
logger.warning(f"重试第 {attempt} 次...")
|
|
|
else:
|
|
|
+ if os.path.exists(save_path):
|
|
|
+ os.remove(save_path)
|
|
|
+ logger.info(f"文件已删除: {save_path}")
|
|
|
logger.error( "达到最大重试次数,处理失败" )
|
|
|
Common.logger( "ai" ).info( f'视频分析处理失败异常信息{e}' )
|
|
|
return f"视频分析处理失败:{e}"
|