2.19 判断是否招标文件
This commit is contained in:
parent
16bab601ca
commit
9f23f7ffcf
@ -29,11 +29,6 @@ def judge_zbfile() -> Any: #判断是否是招标文件
|
|||||||
done = threading.Event() # 标志判断是否完成
|
done = threading.Event() # 标志判断是否完成
|
||||||
pool = current_app.process_pool # 使用全局的进程池
|
pool = current_app.process_pool # 使用全局的进程池
|
||||||
def judge_zbfile_exec_sub(file_path):
|
def judge_zbfile_exec_sub(file_path):
|
||||||
# with multiprocessing.Pool(processes=1) as pool:
|
|
||||||
# result = pool.apply(
|
|
||||||
# judge_zbfile_exec, # 你的实际执行函数
|
|
||||||
# args=(file_path,)
|
|
||||||
# )
|
|
||||||
result = pool.apply(
|
result = pool.apply(
|
||||||
judge_zbfile_exec, # 你的实际执行函数
|
judge_zbfile_exec, # 你的实际执行函数
|
||||||
args=(file_path,)
|
args=(file_path,)
|
||||||
|
@ -4,7 +4,7 @@ import time
|
|||||||
from flask_app.ConnectionLimiter import require_execution_timeout
|
from flask_app.ConnectionLimiter import require_execution_timeout
|
||||||
from flask_app.general.format_change import download_file
|
from flask_app.general.format_change import download_file
|
||||||
from flask_app.routes.utils import validate_and_setup_logger
|
from flask_app.routes.utils import validate_and_setup_logger
|
||||||
from flask_app.routes.货物标解析main import preprocess_file_main
|
from flask_app.routes.货物标解析main import preprocess_file_main, preprocess_files
|
||||||
|
|
||||||
test_process_bp = Blueprint('test_process', __name__)
|
test_process_bp = Blueprint('test_process', __name__)
|
||||||
@test_process_bp.route('/test_process', methods=['POST'])
|
@test_process_bp.route('/test_process', methods=['POST'])
|
||||||
@ -27,8 +27,8 @@ def process_file():
|
|||||||
# print(file_path)
|
# print(file_path)
|
||||||
# 调用预处理函数
|
# 调用预处理函数
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
result=preprocess_file_main(output_folder, file_path, file_type,logger)
|
# result=preprocess_file_main(output_folder, file_path, file_type,logger)
|
||||||
|
result=preprocess_files(output_folder, file_path, file_type,logger)
|
||||||
# 处理结果
|
# 处理结果
|
||||||
if not result:
|
if not result:
|
||||||
return jsonify({'error': 'File processing failed'})
|
return jsonify({'error': 'File processing failed'})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user