Changes committed

This commit is contained in:
2026-06-01 21:49:53 +05:30
parent 8537c653c1
commit 3163bb213e
387 changed files with 21940 additions and 107 deletions

View File

@@ -0,0 +1,39 @@
from __future__ import annotations
from app.core.logging_config import get_logger, setup_logging
logger = get_logger(__name__)
def on_startup() -> None:
"""Application startup event handler."""
setup_logging()
logger.info("application_starting", event="startup")
# Ensure storage directories exist
from app.storage.provider import get_storage_provider
try:
get_storage_provider()
logger.info("storage_initialized")
except Exception as e:
logger.error("storage_init_failed", error=str(e))
# Verify database connection
from app.core.database import check_database_connection
if check_database_connection():
logger.info("database_connected")
else:
logger.error("database_connection_failed")
logger.info("application_started", event="startup_complete")
def on_shutdown() -> None:
"""Application shutdown event handler."""
logger.info("application_shutting_down", event="shutdown")
# Cleanup resources
from app.core.database import engine
engine.dispose()
logger.info("application_stopped", event="shutdown_complete")