INNER CODE UNIT · Python
setup_task_manager_shutdown
CaddyGlow/ccproxy-api · ccproxy/api/app.py:105
async def setup_task_manager_shutdown(app: FastAPI) -> None:
"""Stop the async task manager."""
container: ServiceContainer = app.state.service_container
await stop_task_manager(container=container)
logger.debug("task_manager_shutdown_completed", category="lifecycle")
async def setup_service_container_shutdown(app: FastAPI) -> None:
"""Close the service container and its resources."""
if hasattr(app.state, "service_container"):
service_container = app.state.service_container
await service_container.shutdown()
async def initialize_plugins_startup(app: FastAPI, settings: Settings) -> None:
"""Initialize plugins during startup (runtime phase)."""
if not settings.enable_plugins:
logger.info("plugin_system_disabled", category="lifecycle")