Add voice analytics filters and metrics

This commit is contained in:
2026-04-26 22:00:34 +08:00
parent 3805c18622
commit 55ca0985eb
25 changed files with 710 additions and 39 deletions

View File

@@ -0,0 +1,17 @@
"""Shared helpers for Celery tasks."""
from collections.abc import Awaitable
from typing import TypeVar
from app.db.database import dispose_engine
T = TypeVar("T")
async def run_with_disposed_engine(awaitable: Awaitable[T]) -> T:
"""Run async task work and drop DB pools before the event loop closes."""
try:
return await awaitable
finally:
await dispose_engine()