Sha256: 1b56bb65e0c5fb21bc1b71601a77416f7cdb762055213dcd022bf2ba7135dc67
Contents?: true
Size: 712 Bytes
Versions: 14
Compression:
Stored size: 712 Bytes
Contents
class IngestLocalFileJob < ActiveJob::Base queue_as :ingest_local def perform(file_set_id, directory, filename, user_key) user = User.find_by_user_key(user_key) fail "Unable to find user for #{user_key}" unless user file_set = FileSet.find(file_set_id) file_set.label ||= filename path = File.join(directory, filename) actor = CurationConcerns::FileSetActor.new(file_set, user) if actor.create_content(File.open(path)) FileUtils.rm(path) CurationConcerns.config.callback.run(:after_import_local_file_success, file_set, user, filename) else CurationConcerns.config.callback.run(:after_import_local_file_failure, file_set, user, filename) end end end
Version data entries
14 entries across 14 versions & 2 rubygems