feat: 配置写死与 baked 模块,Alembic 建表,百度仅 BAIDU_*
- 新增 app/baked/algorithm|pipeline,非部署参数不再走 env;Settings 保留 DB/HTTP/RTSP/海康/百度/MinIO/Demo - 移除 init_db_schema 与 reload 配置;main 仅 check_database;start*.sh 在 uvicorn 前执行 alembic upgrade head - 依赖 psycopg[binary] 供 Alembic 同步 URL;alembic/env 注释与预发清单更新 - 撕段门控消费管线、各视频/语音/归档调用改为 baked - 百度环境变量仅 BAIDU_APP_ID、BAIDU_API_KEY、BAIDU_SECRET_KEY 与 BAIDU_* 超时/ASR;人脸脚本与 baidu_speech 文案同步 - 全量单测与 .env.example 更新;.gitignore 忽略 refs/(本地权重/视频不入库) Made-with: Cursor
This commit is contained in:
@@ -20,6 +20,7 @@ from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_asyn
|
||||
|
||||
import app.db.models # noqa: F401 register ORM tables
|
||||
import main as main_module
|
||||
from app.baked import pipeline as bp
|
||||
from app.db.base import Base
|
||||
from app.dependencies import AppContainer, build_container
|
||||
from app.domain.consumption import SurgeryConsumptionStored
|
||||
@@ -79,7 +80,6 @@ def test_durable_fallback_recovers_on_startup_and_persists(
|
||||
return None
|
||||
|
||||
monkeypatch.setattr(main_module, "check_database", _noop)
|
||||
monkeypatch.setattr(main_module, "init_db_schema", _noop)
|
||||
|
||||
class _FakeEngine:
|
||||
async def dispose(self) -> None:
|
||||
@@ -90,10 +90,11 @@ def test_durable_fallback_recovers_on_startup_and_persists(
|
||||
from app.config import settings as real_settings
|
||||
|
||||
monkeypatch.setattr(
|
||||
real_settings, "archive_persist_durable_fallback_dir", str(durable_dir)
|
||||
bp,
|
||||
"ARCHIVE_PERSIST_DURABLE_FALLBACK_DIR",
|
||||
str(durable_dir),
|
||||
)
|
||||
monkeypatch.setattr(real_settings, "auto_create_schema", False)
|
||||
monkeypatch.setattr(real_settings, "archive_persist_retry_interval_seconds", 5.0)
|
||||
monkeypatch.setattr(bp, "ARCHIVE_PERSIST_RETRY_INTERVAL_SECONDS", 5.0)
|
||||
|
||||
def _build(*_a, **_kw) -> AppContainer:
|
||||
return build_container(real_settings, session_factory=sqlite_factory)
|
||||
|
||||
Reference in New Issue
Block a user