Skip to content

Commit

Permalink
Merge pull request #4317 from inspirehep/improve-logging
Browse files Browse the repository at this point in the history
workflows: improve logging for download documents
  • Loading branch information
drjova authored Oct 17, 2023
2 parents d6e8769 + 218fd84 commit 08a4a1b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inspirehep/modules/workflows/tasks/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,15 @@ def populate_submission_document(obj, eng):

@with_debug_logging
def download_documents(obj, eng):
LOGGER.info('Downloading documents for %s', obj.id)
documents = obj.data.get('documents', [])
for document in documents:
filename = document['key']
url = document['url']
scheme = urlparse(url).scheme
LOGGER.info(
'Downloading document key:%s url:%s scheme:%s', document['key'], document['url'], scheme
)
if scheme == 'file':
downloaded = copy_file_to_workflow(obj, filename, url)
else:
Expand Down

0 comments on commit 08a4a1b

Please sign in to comment.