2.19 判断是否招标文件
This commit is contained in:
parent
f25cd9c75e
commit
1795a4b2cf
@ -27,12 +27,12 @@ def judge_zbfile() -> Any: #判断是否是招标文件
|
|||||||
unique_id = g.unique_id
|
unique_id = g.unique_id
|
||||||
result = [None] # 用于存储结果的可变对象
|
result = [None] # 用于存储结果的可变对象
|
||||||
done = threading.Event() # 标志判断是否完成
|
done = threading.Event() # 标志判断是否完成
|
||||||
pool = current_app.process_pool # 使用全局的进程池
|
|
||||||
def judge_zbfile_exec_sub(file_path):
|
def judge_zbfile_exec_sub(file_path):
|
||||||
result = pool.apply(
|
with multiprocessing.Pool(processes=1) as pool:
|
||||||
judge_zbfile_exec, # 你的实际执行函数
|
result = pool.apply(
|
||||||
args=(file_path,)
|
judge_zbfile_exec, # 你的实际执行函数
|
||||||
)
|
args=(file_path,)
|
||||||
|
)
|
||||||
return result
|
return result
|
||||||
def wrapper() -> None:
|
def wrapper() -> None:
|
||||||
"""
|
"""
|
||||||
|
@ -20,5 +20,5 @@ def warmup_request():
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app = create_app()
|
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)
|
serve(app, host='0.0.0.0', port=5000)
|
@ -16,7 +16,6 @@ from flask_app.routes.test_preprocess import test_process_bp
|
|||||||
def create_app():
|
def create_app():
|
||||||
# 创建全局日志记录器
|
# 创建全局日志记录器
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.process_pool = Pool(processes=10, maxtasksperchild=1)
|
|
||||||
app.global_logger = create_logger_main('model_log') # 全局日志记录器
|
app.global_logger = create_logger_main('model_log') # 全局日志记录器
|
||||||
# 注册蓝图
|
# 注册蓝图
|
||||||
app.register_blueprint(get_deviation_bp)
|
app.register_blueprint(get_deviation_bp)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user