From 48109c53aabd0656f3c3da15f1077a9524b8d92c Mon Sep 17 00:00:00 2001 From: msramalho <19508417+msramalho@users.noreply.github.com> Date: Thu, 29 Feb 2024 13:30:21 +0000 Subject: [PATCH] error logs updated --- src/worker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/worker.py b/src/worker.py index 3a7ac08..c4ae172 100644 --- a/src/worker.py +++ b/src/worker.py @@ -48,7 +48,7 @@ def create_archive_task(self, archive_json: str): orchestrator = choose_orchestrator(archive.group_id, archive.author_id) result = orchestrator.feed_item(Metadata().set_url(url)) - + try: insert_result_into_db(result, archive.tags, archive.public, archive.group_id, archive.author_id, self.request.id) except Exception as e: @@ -165,7 +165,7 @@ def is_group_invalid_for_user(public: bool, group_id: str, author_id: str): def insert_result_into_db(result: Metadata, tags: Set[str], public: bool, group_id: str, author_id: str, task_id: str) -> str: logger.info(f"INSERTING {public=} {group_id=} {author_id=} {tags=} into {task_id}") - assert result, f"UNABLE TO archive: {result.get_url()}" + assert result, f"UNABLE TO archive: {result.get_url() if result else result}" with get_db() as session: # urls are created by get_all_urls # create author_id if needed