- 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)
8 lines
224 B
Python
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"))
|