INNER CODE UNIT · Python
shutdown_plugins
CaddyGlow/ccproxy-api · ccproxy/api/app.py:161
async def shutdown_plugins(app: FastAPI) -> None:
"""Shutdown plugins."""
if hasattr(app.state, "plugin_registry"):
plugin_registry: PluginRegistry = app.state.plugin_registry
await plugin_registry.shutdown_all()
logger.debug("plugins_shutdown_completed", category="lifecycle")
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: