INNER CODE UNIT · Python
shutdown_hook_system
CaddyGlow/ccproxy-api · ccproxy/api/app.py:169
async def shutdown_hook_system(app: FastAPI) -> None:
"""Shutdown the hook system and background thread."""
try:
# Get hook manager from app state - it will shutdown its own background manager
hook_manager = getattr(app.state, "hook_manager", None)
if hook_manager:
hook_manager.shutdown()
logger.debug("hook_system_shutdown_completed", category="lifecycle")
except Exception as e:
logger.error(
"hook_system_shutdown_failed",
error=str(e),
category="lifecycle",
)
async def initialize_hooks_startup(app: FastAPI, settings: Settings) -> None: