|
|
@ -160,6 +160,14 @@ async def ai_seo_job(browser, platform_ids, time_range, job_id, type_name, run_i |
|
|
# data.update(rest.get("data")) |
|
|
# data.update(rest.get("data")) |
|
|
# search_results.append(data) |
|
|
# search_results.append(data) |
|
|
# answer_data['search_result'] = search_results |
|
|
# answer_data['search_result'] = search_results |
|
|
|
|
|
|
|
|
|
|
|
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}") |
|
|
|
|
|
logger.info(f"{answer_data.get('answer', '')}") |
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
result = await AiSeoApis.submit_task(answer_data) |
|
|
result = await AiSeoApis.submit_task(answer_data) |
|
|
logger.info(f"任务提交成功: id: {task_data['id']}") |
|
|
logger.info(f"任务提交成功: id: {task_data['id']}") |
|
|
spider_pool.pop(run_id, None) |
|
|
spider_pool.pop(run_id, None) |
|
|
|