Sha256: 83836f2d32a3b0be64bb29e21ce6d61d08df4de0d87246eb9424779f427a5be2
Contents?: true
Size: 1.14 KB
Versions: 19
Compression:
Stored size: 1.14 KB
Contents
class CharacterizeJob < Hyrax::ApplicationJob queue_as Hyrax.config.ingest_queue_name # Characterizes the file at 'filepath' if available, otherwise, pulls a copy from the repository # and runs characterization on that file. # @param [FileSet] file_set # @param [String] file_id identifier for a Hydra::PCDM::File # @param [String, NilClass] filepath the cached file within the Hyrax.config.working_path 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) Hydra::Works::CharacterizationService.run(file_set.characterization_proxy, filepath) Rails.logger.debug "Ran characterization on #{file_set.characterization_proxy.id} (#{file_set.characterization_proxy.mime_type})" file_set.characterization_proxy.save! file_set.update_index file_set.parent.in_collections.each(&:update_index) if file_set.parent CreateDerivativesJob.perform_later(file_set, file_id, filepath) end end
Version data entries
19 entries across 19 versions & 1 rubygems