Skip to content

Commit b26a25b

Browse files
committed
Update cache info logic in moderation orchestrator
Refines the cache information display by checking for stored cache results instead of relying solely on request time and cache hits. This provides more accurate feedback about cache usage in moderation requests.
1 parent 194b621 commit b26a25b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

app/services/moderation_orchestrator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ async def moderate_content(self, content_id, request_start_time=None):
8080

8181
# Get cache summary for this request
8282
cache_summary = self.ai_moderator.cache.get_request_cache_summary()
83-
if total_time < 0.5 and cache_summary['hits'] > 0:
83+
if cache_summary.get('stores', 0) > 0:
84+
cache_info = f" [cached {cache_summary['stores']} results]"
85+
elif total_time < 0.5:
8486
cache_info = " [cached]"
8587
else:
8688
cache_info = ""

0 commit comments

Comments
 (0)