From adfae32f0c3646bf40a382c8023b0d9e521bbe8c Mon Sep 17 00:00:00 2001 From: zzx Date: Sun, 28 Sep 2025 20:09:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(run.py):=E4=BF=AE=E5=A4=8D=20answer=5Fdata?= =?UTF-8?q?=20=E9=95=BF=E5=BA=A6=E5=88=A4=E6=96=AD=E8=AF=AD=E6=B3=95?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正了 answer_data 中 answer 字段长度判断的语法错误,原条件表达式缺少右括号,导致逻辑判断异常。此修复确保当 answer 长度小于等于 20 时能正确更新任务状态并记录错误日志。 --- run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run.py b/run.py index ff2e934..47e8dbd 100644 --- a/run.py +++ b/run.py @@ -161,7 +161,7 @@ async def ai_seo_job(browser, platform_ids, time_range, job_id, type_name, run_i # search_results.append(data) # answer_data['search_result'] = search_results - if len(answer_data.get('answer', '') <= 20): + if len(answer_data.get('answer', '')) <= 20: await AiSeoApis.update_task_status(task_id, 4) logger.error(f"爬虫结果长度过短: id: {task_data['id']} platform_id: {task_data['platform_id']}") logger.error(f"回滚任务状态: id: {task_id}")