Skip to content

Commit

Permalink
changing behaviour upon lack of uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
ergoregion committed Nov 5, 2024
1 parent 8f9d8e5 commit d6bbeac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 2 additions & 5 deletions agate/agate/queue_reading/ingestion_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@ def update(cls, data: dict, stage: str):
"""
Use a dictionary to update items in the database
"""
try:
uuid = data["uuid"]
except KeyError:
logger.critical("no uuid")
return
uuid = data["uuid"]

cls._manipulate_data(data, stage)
cls._update_item(uuid, data)

Expand Down
7 changes: 6 additions & 1 deletion agate/agate/queue_reading/queue_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ def _update_item_from_message(self, message, stage: str):
except json.decoder.JSONDecodeError:
logger.critical(f"{stage}: not a valid json message: {message.body}")
return
IngestionUpdater.update(data, stage)

if "uuid" in data:
# This message prompts updates to an injection attempt
IngestionUpdater.update(data, stage)
else:
logger.warning(f"{stage}: message did not refer to a uuid: {message.body}")

def _update_lists(self, message):
"""
Expand Down

0 comments on commit d6bbeac

Please sign in to comment.