зеркало из https://github.com/mozilla/taar.git
lowered logging level for failed client lookups in dynamo
This commit is contained in:
Родитель
ac4f3a3c26
Коммит
7110da8f85
|
@ -39,11 +39,14 @@ class ProfileController:
|
||||||
json_byte_data = zlib.decompress(compressed_bytes)
|
json_byte_data = zlib.decompress(compressed_bytes)
|
||||||
json_str_data = json_byte_data.decode('utf8')
|
json_str_data = json_byte_data.decode('utf8')
|
||||||
return json.loads(json_str_data)
|
return json.loads(json_str_data)
|
||||||
|
except KeyError:
|
||||||
|
# No client ID found - not really an error
|
||||||
|
return None
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# Return None on error. The caller in ProfileFetcher will
|
# Return None on error. The caller in ProfileFetcher will
|
||||||
# handle error logging
|
# handle error logging
|
||||||
msg = "Error loading client data for {}. Error: {}"
|
msg = "Error loading client data for {}. Error: {}"
|
||||||
self.logger.error(msg.format(client_id, str(e)))
|
self.logger.debug(msg.format(client_id, str(e)))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,7 +68,7 @@ class ProfileFetcher:
|
||||||
profile_data = self._client.get_client_profile(client_id)
|
profile_data = self._client.get_client_profile(client_id)
|
||||||
|
|
||||||
if profile_data is None:
|
if profile_data is None:
|
||||||
self.logger.error("Client profile not found", extra={"client_id": client_id})
|
self.logger.debug("Client profile not found", extra={"client_id": client_id})
|
||||||
return None
|
return None
|
||||||
|
|
||||||
addon_ids = [addon['addon_id']
|
addon_ids = [addon['addon_id']
|
||||||
|
|
|
@ -106,7 +106,7 @@ class RecommendationManager:
|
||||||
|
|
||||||
client_info = self.profile_fetcher.get(client_id)
|
client_info = self.profile_fetcher.get(client_id)
|
||||||
if client_info is None:
|
if client_info is None:
|
||||||
self.logger.warning(
|
self.logger.info(
|
||||||
"Defaulting to empty results. No client info fetched from dynamo."
|
"Defaulting to empty results. No client info fetched from dynamo."
|
||||||
)
|
)
|
||||||
return []
|
return []
|
||||||
|
|
Загрузка…
Ссылка в новой задаче