2.19 判断是否招标文件

This commit is contained in:
zy123 2025-02-19 15:50:28 +08:00
parent f25cd9c75e
commit 1795a4b2cf
3 changed files with 6 additions and 7 deletions

View File

@ -27,12 +27,12 @@ def judge_zbfile() -> Any: #判断是否是招标文件
unique_id = g.unique_id
result = [None] # 用于存储结果的可变对象
done = threading.Event() # 标志判断是否完成
pool = current_app.process_pool # 使用全局的进程池
def judge_zbfile_exec_sub(file_path):
result = pool.apply(
judge_zbfile_exec, # 你的实际执行函数
args=(file_path,)
)
with multiprocessing.Pool(processes=1) as pool:
result = pool.apply(
judge_zbfile_exec, # 你的实际执行函数
args=(file_path,)
)
return result
def wrapper() -> None:
"""

View File

@ -20,5 +20,5 @@ def warmup_request():
if __name__ == "__main__":
app = create_app()
threading.Thread(target=warmup_request, daemon=True).start()
# threading.Thread(target=warmup_request, daemon=True).start()
serve(app, host='0.0.0.0', port=5000)

View File

@ -16,7 +16,6 @@ from flask_app.routes.test_preprocess import test_process_bp
def create_app():
# 创建全局日志记录器
app = Flask(__name__)
app.process_pool = Pool(processes=10, maxtasksperchild=1)
app.global_logger = create_logger_main('model_log') # 全局日志记录器
# 注册蓝图
app.register_blueprint(get_deviation_bp)