Skip to content

Commit

Permalink
Add a guard around run_log_file in v2 worker monitor (#1026)
Browse files Browse the repository at this point in the history
  • Loading branch information
sambles authored Apr 24, 2024
1 parent f9e9894 commit f8fc6d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/server/oasisapi/analyses/v2_api/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,9 @@ def record_losses_files(self, result, analysis_id=None, initiator_id=None, slug=
))

# Store logs and output
analysis.run_log_file = store_file(result['run_logs'], 'application/gzip', initiator, filename=f'analysis_{analysis_id}_logs.tar.gz')
if result.get('run_logs', None):
analysis.run_log_file = store_file(result['run_logs'], 'application/gzip', initiator, filename=f'analysis_{analysis_id}_logs.tar.gz')

analysis.output_file = store_file(result['output_location'], 'application/gzip', initiator, filename=f'analysis_{analysis_id}_output.tar.gz')

analysis.save()
Expand Down

0 comments on commit f8fc6d3

Please sign in to comment.