Skip to content

Commit

Permalink
Update RequestDerivativesJob to set perform_derivative_processing to …
Browse files Browse the repository at this point in the history
…false if no derivatives are needed
  • Loading branch information
elohanlon committed Dec 24, 2024
1 parent 596857c commit 2f4521b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/jobs/request_derivatives_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ def perform(digital_object_pid)
return unless eligible_asset?(asset)

requested_derivatives = required_derivatives_for_asset(asset)
return if requested_derivatives.empty?

# If no derivatives are needed, then we'll set perform_derivative_processing to false and return
if requested_derivatives.empty?
asset.perform_derivative_processing = false
asset.save
return
end

if requested_derivatives.present?
RestClient.post(
Expand Down

0 comments on commit 2f4521b

Please sign in to comment.