0.1.11 ai修复与全屏
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import asyncio
|
||||
from fastapi import FastAPI
|
||||
|
||||
from app.api.routes import router as api_router
|
||||
from app.core.config import get_settings
|
||||
from app.core.logging import setup_logging
|
||||
from app.services.runtime import scheduler, worker
|
||||
from app.services.runtime import auto_indexer, scheduler, worker
|
||||
|
||||
settings = get_settings()
|
||||
|
||||
@@ -17,6 +16,17 @@ app.include_router(api_router, prefix=settings.api_prefix)
|
||||
@app.on_event("startup")
|
||||
async def _startup() -> None:
|
||||
scheduler.start()
|
||||
if getattr(settings, "auto_index_enabled", False):
|
||||
try:
|
||||
await auto_indexer.startup()
|
||||
except Exception: # noqa: BLE001
|
||||
# 启动阶段不阻塞服务:自动入库失败会在后续 tick 中继续重试/记录
|
||||
pass
|
||||
scheduler.add_interval_job(
|
||||
job_id="auto_index_tick",
|
||||
func=auto_indexer.tick,
|
||||
seconds=int(getattr(settings, "auto_index_interval_seconds", 5)),
|
||||
)
|
||||
await worker.start()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user