feat(shipping-notice): 增强发货通知与订单抽取功能,支持多进程处理与紧急停止
- 移除不再使用的 SHIPPING_NOTICE_LAYOUT_PARSER_REVISION 配置 - 在环境配置中新增 SHIPPING_NOTICE_WORKER_CONCURRENCY 和 SHIPPING_NOTICE_JOB_RUNNING_TIMEOUT_SECONDS - 实现发货通知 worker 进程,支持并发处理订单抽取任务 - 引入紧急停止功能,允许管理员在运行中控制订单解析状态 - 更新相关 API,支持读取与设置紧急停止状态 - 增强文档与代码注释,反映新的业务逻辑与功能要求
This commit is contained in:
1 parent
d0fe084999
commit
b352c281d5
149 files changed
+12550
-1874
No files matched your search
@@ -7,9 +7,11 @@ tests/conftest.py
|
||||
配合 pytest.ini 的 retention=0,避免 %TEMP%/pytest-current 清理 PermissionError。
|
||||
"""
|
||||
|
||||
import pytest
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _capture_legacy_order_rows_for_tests(monkeypatch):
|
||||
@@ -401,6 +403,23 @@ def pytest_configure(config):
|
||||
config.option.basetemp = str(basetemp)
|
||||
|
||||
|
||||
def pytest_unconfigure(config):
|
||||
"""
|
||||
测试结束后删除仓库内显式指定的旧式 pytest 临时目录。
|
||||
|
||||
核心逻辑:仅清理 backend 直属且名称以 .pytest- 开头的 basetemp;默认
|
||||
backend/.pytest_tmp/run 保留复用,仓库外路径与其他目录不处理。
|
||||
"""
|
||||
basetemp_value = getattr(config.option, 'basetemp', None)
|
||||
if not basetemp_value:
|
||||
return
|
||||
|
||||
backend_dir = Path(__file__).resolve().parents[1]
|
||||
basetemp = Path(basetemp_value).resolve()
|
||||
if basetemp.parent == backend_dir and basetemp.name.startswith('.pytest-'):
|
||||
shutil.rmtree(basetemp, ignore_errors=True)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def app():
|
||||
from app import create_app, db
|
||||
|
||||
Reference in new issue
Block a user