Skip to content

Commit

Permalink
tasks: improve exception log grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
slint committed Feb 2, 2024
1 parent d72bd00 commit 92061c1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions invenio_records_resources/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from invenio_indexer.tasks import process_bulk_queue

from .proxies import current_notifications_registry, current_service_registry
from .services.errors import FileKeyNotFoundError


@shared_task(ignore_result=True)
Expand All @@ -26,9 +25,8 @@ def extract_file_metadata(service_id, record_id, file_key):
try:
service = current_service_registry.get(service_id)
service.extract_file_metadata(system_identity, record_id, file_key)

except FileKeyNotFoundError as e:
current_app.logger.error(e)
except Exception:
current_app.logger.exception("Failed to extract file metadata.")


@shared_task(ignore_result=True)
Expand Down

0 comments on commit 92061c1

Please sign in to comment.