agnes-the-ai-analyst/app/utils.py
ZdenekSrotyr 53a9e838f9 feat: add graceful shutdown handler
- Add close_system_db() function in src/db.py to cleanly close shared DB connection
- Add lifespan context manager in app/main.py to trigger shutdown on app exit
- Integrate lifespan into FastAPI app initialization
- All API tests pass (77/77)
2026-04-09 07:03:45 +02:00

8 lines
224 B
Python

"""Shared utilities for the FastAPI application."""
import os
from pathlib import Path
def get_data_dir() -> Path:
"""Return the configured data directory path."""
return Path(os.environ.get("DATA_DIR", "./data"))