Skip to content

Commit

Permalink
handle file deletion if even ai docs not found
Browse files Browse the repository at this point in the history
  • Loading branch information
celuchmarek committed Oct 9, 2024
1 parent f59eadb commit d20b654
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/jobs/metais/project_data_extraction_result_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ def perform(project_uuid, location_header)
raise RuntimeError.new('Result status is not "Done"') unless body['status'] == 'Done'

result = body['result']
return if ['No documents', 'No documents for project plan'].include? result['detail']

metais_project = find_metais_project(project_uuid)
project_origin = find_or_initialize_project_origin(metais_project)
unless ['No documents', 'No documents for project plan'].include? result['detail']
metais_project = find_metais_project(project_uuid)
project_origin = find_or_initialize_project_origin(metais_project)

update_project_origin(project_origin, result)
process_harmonogram(result['harmonogram'], project_origin)
update_project_origin(project_origin, result)
process_harmonogram(result['harmonogram'], project_origin)
end

Metais::ProjectDataExtractionDeleteJob.perform_later(project_uuid)
end
Expand Down

0 comments on commit d20b654

Please sign in to comment.