2.20 主流程改为多线程测试

This commit is contained in:
zy123 2025-02-20 15:32:41 +08:00
parent 85b9406ec1
commit 1581e305ec
2 changed files with 9 additions and 7 deletions

View File

@ -249,6 +249,7 @@ def engineering_bid_main(output_folder, file_path, file_type, unique_id):
} }
yield json.dumps(error_response, ensure_ascii=False) yield json.dumps(error_response, ensure_ascii=False)
return # 停止进一步处理 return # 停止进一步处理
#with ProcessPoolExecutor() as executor:
with ThreadPoolExecutor() as executor: with ThreadPoolExecutor() as executor:
# 立即启动不依赖 knowledge_name 和 index 的任务 # 立即启动不依赖 knowledge_name 和 index 的任务
futures = { futures = {

View File

@ -241,20 +241,21 @@ def goods_bid_main(output_folder, file_path, file_type, unique_id):
} }
yield json.dumps(error_response, ensure_ascii=False) yield json.dumps(error_response, ensure_ascii=False)
return # 停止进一步处理 return # 停止进一步处理
#with ProcessPoolExecutor() as executor:
with ThreadPoolExecutor() as executor: #开启子进程,能保证运行结束后回收资源消耗 with ThreadPoolExecutor() as executor: #开启子进程,能保证运行结束后回收资源消耗
# 立即启动不依赖 knowledge_name 和 index 的任务 # 立即启动不依赖 knowledge_name 和 index 的任务
futures = { futures = {
# 'evaluation_standards': executor.submit(fetch_evaluation_standards,processed_data['invalid_deleted_docx'], #技术评分 商务评分 # 'evaluation_standards': executor.submit(fetch_evaluation_standards,processed_data['invalid_deleted_docx'], #技术评分 商务评分
# processed_data['evaluation_method_path'],logger), # processed_data['evaluation_method_path'],logger),
'invalid_requirements': executor.submit(fetch_invalid_requirements, processed_data['invalid_added_docx'], #无效标与废标项 # 'invalid_requirements': executor.submit(fetch_invalid_requirements, processed_data['invalid_added_docx'], #无效标与废标项
output_folder,logger), # output_folder,logger),
# 'bidding_documents_requirements': executor.submit(fetch_bidding_documents_requirements,processed_data['invalid_deleted_docx'],processed_data['merged_baseinfo_path'], 'bidding_documents_requirements': executor.submit(fetch_bidding_documents_requirements,processed_data['invalid_deleted_docx'],processed_data['merged_baseinfo_path'],
# processed_data['clause_path'],logger), #投标文件要求 processed_data['clause_path'],logger), #投标文件要求
#
# 'opening_bid': executor.submit(fetch_bid_opening, processed_data['invalid_deleted_docx'],processed_data['merged_baseinfo_path'], 'opening_bid': executor.submit(fetch_bid_opening, processed_data['invalid_deleted_docx'],processed_data['merged_baseinfo_path'],
# processed_data['clause_path'],logger), #开评定标流程 processed_data['clause_path'],logger), #开评定标流程
# 'base_info': executor.submit(fetch_project_basic_info, processed_data['invalid_deleted_docx'],processed_data['merged_baseinfo_path'], #基础信息 # 'base_info': executor.submit(fetch_project_basic_info, processed_data['invalid_deleted_docx'],processed_data['merged_baseinfo_path'], #基础信息
# processed_data['procurement_path'],processed_data['clause_path'],logger), # processed_data['procurement_path'],processed_data['clause_path'],logger),