Fix: disable LLM cache recording while enable_llm_cache is disabled

This commit is contained in:
yangdx
2025-04-15 21:01:06 +08:00
parent 69540b7c21
commit 2e95947c40

View File

@@ -731,6 +731,9 @@ async def save_to_cache(hashing_kv, cache_data: CacheData):
hashing_kv: The key-value storage for caching hashing_kv: The key-value storage for caching
cache_data: The cache data to save cache_data: The cache data to save
""" """
if not hashing_kv.global_config.get("enable_llm_cache"):
return
# Skip if storage is None or content is a streaming response # Skip if storage is None or content is a streaming response
if hashing_kv is None or not cache_data.content: if hashing_kv is None or not cache_data.content:
return return