Class: CharacterizeJob
- Inherits:
-
Hyrax::ApplicationJob
- Object
- ApplicationJob
- Hyrax::ApplicationJob
- CharacterizeJob
- Defined in:
- app/jobs/characterize_job.rb
Instance Method Summary collapse
-
#perform(file_set, file_id, filepath = nil) ⇒ Object
Characterizes the file at ‘filepath’ if available, otherwise, pulls a copy from the repository and runs characterization on that file.
Instance Method Details
#perform(file_set, file_id, filepath = nil) ⇒ Object
Characterizes the file at ‘filepath’ if available, otherwise, pulls a copy from the repository and runs characterization on that file.
10 11 12 13 14 15 |
# File 'app/jobs/characterize_job.rb', line 10 def perform(file_set, file_id, filepath = nil) raise "#{file_set.class.characterization_proxy} was not found for FileSet #{file_set.id}" unless file_set.characterization_proxy? filepath = Hyrax::WorkingDirectory.find_or_retrieve(file_id, file_set.id) unless filepath && File.exist?(filepath) characterize(file_set, file_id, filepath) CreateDerivativesJob.perform_later(file_set, file_id, filepath) end |