feat: 新增数据库前置检查,缺表按 db_init 预设自动建好(sector/sector_band_ref/cellinfo)

This commit is contained in:
2026-06-26 11:24:24 +08:00
parent 98f03b3e0e
commit 5914046dec
9 changed files with 254 additions and 34 deletions
+6
View File
@@ -43,6 +43,12 @@ LOGIN_ONLY_API_PREFIXES = (
@asynccontextmanager
async def app_lifespan(app: FastAPI):
try:
from app.config import AppConfig
from app.db_init import ensure_required_tables
ensure_required_tables(AppConfig.load())
except Exception as exc: # noqa: BLE001
print(f"[前置检查] 启动检查异常:{exc}")
state.auto_scheduler = AutoScheduler()
state.auto_scheduler.start()
try: