MCPcopy Create free account
hub / github.com/TheSmallHanCat/flow2api / update_cache_enabled

Function update_cache_enabled

src/api/admin.py:1717–1729  ·  view source on GitHub ↗

Update cache enabled status

(
    request: dict,
    token: str = Depends(verify_admin_token)
)

Source from the content-addressed store, hash-verified

1715
1716@router.post("/api/cache/enabled")
1717async def update_cache_enabled(
1718 request: dict,
1719 token: str = Depends(verify_admin_token)
1720):
1721 """Update cache enabled status"""
1722 enabled = request.get("enabled", False)
1723 await db.update_cache_config(enabled=enabled)
1724
1725 # 🔥 Hot reload: sync database config to memory
1726 await db.reload_config_to_memory()
1727 await _sync_runtime_cache_config()
1728
1729 return {"success": True, "message": f"缓存已{'启用' if enabled else '禁用'}"}
1730
1731
1732@router.post("/api/cache/config")

Callers

nothing calls this directly

Calls 3

update_cache_configMethod · 0.80

Tested by

no test coverage detected