fix(api): share operator summary cache through redis
Some checks failed
CD Pipeline / tests (push) Successful in 1m20s
Code Review / ai-code-review (push) Successful in 13s
CD Pipeline / build-and-deploy (push) Successful in 3m35s
CD Pipeline / post-deploy-checks (push) Failing after 20s

This commit is contained in:
Your Name
2026-06-01 09:38:08 +08:00
parent 8938706062
commit d4483e730e
4 changed files with 177 additions and 8 deletions

View File

@@ -61,8 +61,8 @@ from src.services.ollama_failover_manager import (
from src.services.ollama_health_monitor import HealthReport, HealthStatus
from src.services.operator_outcome import build_operator_outcome
from src.services.operator_summary_cache import (
get_cached_operator_summary,
store_operator_summary,
get_cached_operator_summary_async,
store_operator_summary_async,
)
from src.services.run_state_machine import transition
@@ -337,7 +337,7 @@ async def list_callback_replies(
"per_page": per_page,
}
if not refresh:
cached_response = get_cached_operator_summary(
cached_response = await get_cached_operator_summary_async(
"callback_replies",
cache_key,
ttl_seconds=_CALLBACK_REPLY_CACHE_TTL_SECONDS,
@@ -515,7 +515,7 @@ async def list_callback_replies(
cache_status="miss",
cache_ttl_seconds=_CALLBACK_REPLY_CACHE_TTL_SECONDS,
)
return store_operator_summary(
return await store_operator_summary_async(
"callback_replies",
cache_key,
response,