From 71544e7f35fdbab9ed9ae05159aae7c7a2bdca75 Mon Sep 17 00:00:00 2001 From: Alex Dusenbery Date: Mon, 31 Jul 2023 10:29:02 -0400 Subject: [PATCH] fix: don't log useless/opaque cache keys --- enterprise_subsidy/apps/content_metadata/api.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/enterprise_subsidy/apps/content_metadata/api.py b/enterprise_subsidy/apps/content_metadata/api.py index f9e3c445..b07f4066 100644 --- a/enterprise_subsidy/apps/content_metadata/api.py +++ b/enterprise_subsidy/apps/content_metadata/api.py @@ -209,19 +209,22 @@ def get_content_metadata(enterprise_customer_uuid, content_identifier): cache_key = content_metadata_cache_key(enterprise_customer_uuid, content_identifier) cached_response = TieredCache.get_cached_response(cache_key) if cached_response.is_found: - logger.info('[CONTENT METADATA CACHE HIT] for key %s', cache_key) return cached_response.value - logger.info('[CONTENT METADATA CACHE MISS] for key %s', cache_key) course_details = EnterpriseCatalogApiClient().get_content_metadata_for_customer( enterprise_customer_uuid, content_identifier ) if course_details: - logger.info('[CONTENT METADATA CACHE SET] for key %s', cache_key) TieredCache.set_all_tiers( cache_key, course_details, django_cache_timeout=CONTENT_METADATA_CACHE_TIMEOUT, ) + logger.info( + 'Fetched course details %s for customer %s and content_identifier %s', + course_details, + enterprise_customer_uuid, + content_identifier, + ) return course_details