From 7422f758dd0f9709b8f91bac225c20beb7275e24 Mon Sep 17 00:00:00 2001 From: Alex Dusenbery Date: Mon, 2 Oct 2023 09:39:41 -0400 Subject: [PATCH] Revert "fix: add more memcache debugging to discovery cache client" This reverts commit 6a15a5547f026c0503c79904c0f3cdd87723ccf1. --- .../apps/api_client/discovery_cache.py | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/enterprise_catalog/apps/api_client/discovery_cache.py b/enterprise_catalog/apps/api_client/discovery_cache.py index 7fe59d6e5..59d57d556 100644 --- a/enterprise_catalog/apps/api_client/discovery_cache.py +++ b/enterprise_catalog/apps/api_client/discovery_cache.py @@ -62,27 +62,10 @@ def _get_catalog_query_metadata(self, catalog_query): catalog_query_data = client.get_metadata_by_query(catalog_query) if not catalog_query_data: catalog_query_data = [] - # cache.add() will not attempt to update the cache if the key specified is already present # this is fine here, because we know we just encountered a cache miss on our key. # add() returns a boolean letting us know if it stored anything in the cache - # Debugging: force ignore_exc off to see what exception is getting raise - # on the cache adds. - if hasattr(cache, '_options'): - cache._options['ignore_exc'] = False # pylint: disable=protected-access - cache_add_success = False - try: - cache_add_success = cache.add( - cache_key, - catalog_query_data, - settings.DISCOVERY_CATALOG_QUERY_CACHE_TIMEOUT, - ) - except Exception as exc: # pylint: disable=broad-except - LOGGER.exception('Cache add fail %s', exc) - finally: - if hasattr(cache, '_options'): - cache._options['ignore_exc'] = True # pylint: disable=protected-access - + cache_add_success = cache.add(cache_key, catalog_query_data, settings.DISCOVERY_CATALOG_QUERY_CACHE_TIMEOUT) if cache_add_success: LOGGER.info( 'CatalogQueryDetails: CACHED CatalogQuery metadata with id %s for %s sec',