INNER CODE UNIT · Python

_dispose_database_engine

skygazer42/MimirQ · app/main.py:409

def _dispose_database_engine() -> None:
    try:
        engine.dispose()
        logger.info("Database engine disposed")
    except Exception as exc:  # noqa: BLE001
        logger.warning("Failed to dispose database engine: %s", str(exc)[:200])


# Lifespan management
@asynccontextmanager
async def lifespan(app: FastAPI):
    """Operations on app startup and shutdown."""
    # Startup: create database tables.
    logger.info("Starting MimirQ backend...")
    _ensure_startup_directories()
    _ensure_optional_log_directories()
    _setup_langsmith_tracing()
    _initialize_database_for_startup()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…