feat: 新增数据库前置检查,缺表按 db_init 预设自动建好(sector/sector_band_ref/cellinfo)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user