Skip to content

Commit bdb36d3

Browse files
author
Bob Strahan
committed
store cached attributes rather than JSON string in cache. Log PK for easier debugging
1 parent 1eee667 commit bdb36d3

File tree

1 file changed

+7
-1
lines changed
  • lib/idp_common_pkg/idp_common/classification

1 file changed

+7
-1
lines changed

lib/idp_common_pkg/idp_common/classification/service.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,11 @@ def _get_cached_page_classifications(
10181018
Returns:
10191019
Dictionary mapping page_id to cached PageClassification, empty dict if no cache
10201020
"""
1021+
1022+
logger.info(
1023+
f"Attempting to retrieve cached page classifications for document {document.id}"
1024+
)
1025+
10211026
if not self.cache_table:
10221027
return {}
10231028

@@ -1027,11 +1032,12 @@ def _get_cached_page_classifications(
10271032
response = self.cache_table.get_item(Key={"PK": cache_key, "SK": "none"})
10281033

10291034
if "Item" not in response:
1030-
logger.debug(f"No cache entry found for document {document.id}")
1035+
logger.info(f"No cache entry found for document {document.id}")
10311036
return {}
10321037

10331038
# Parse cached data
10341039
cached_data = response["Item"]
1040+
logger.debug(f"Cached data: {cached_data}")
10351041
page_classifications = {}
10361042

10371043
# Extract page classifications from separate page attributes

0 commit comments

Comments
 (0)