F2: persist native job projections and expose task controls

This commit is contained in:
Xin Wang
2026-10-23 16:03:40 +08:00
parent bae5ec3c58
commit 33fde56edd
13 changed files with 550 additions and 5 deletions
+5
View File
@@ -49,6 +49,7 @@ from starlette.exceptions import HTTPException as StarletteHTTPException
from routes import (
assistants,
background_tasks,
auth,
conversations,
health,
@@ -80,6 +81,8 @@ async def lifespan(_app: FastAPI):
await recover_interrupted_webhooks()
await recover_interrupted_test_runs()
await recover_interrupted_responses()
from services.background_tasks.service import task_service
await task_service.start()
analysis_worker = asyncio.create_task(
run_analysis_worker(), name="post-call-analysis-worker"
)
@@ -89,6 +92,7 @@ async def lifespan(_app: FastAPI):
try:
yield
finally:
await task_service.close()
analysis_worker.cancel()
webhook_worker.cancel()
await asyncio.gather(
@@ -193,6 +197,7 @@ app.include_router(test_cases.router)
app.include_router(test_assets.router)
app.include_router(test_runs.router)
app.include_router(tools.router)
app.include_router(background_tasks.router)
app.include_router(voice_webrtc.router)
app.include_router(voice_ws.router)