Sha256: fdd6b16b5c9744ecb46d81c1b5dbc3a8f3657a45fcc18246b8bffbaee4997313

Contents?: true

Size: 689 Bytes

Versions: 25

Compression:

Stored size: 689 Bytes

Contents

# frozen_string_literal: true
class IngestJob < Hyrax::ApplicationJob
  queue_as Hyrax.config.ingest_queue_name

  after_perform do |job|
    # We want the lastmost Hash, if any.
    opts = job.arguments.reverse.detect { |x| x.is_a? Hash } || {}
    wrapper = job.arguments.first
    ContentNewVersionEventJob.perform_later(wrapper.file_set, wrapper.user) if opts[:notification]
  end

  # @param [JobIoWrapper] wrapper
  # @param [Boolean] notification send the user a notification, used in after_perform callback
  # @see 'config/initializers/hyrax_callbacks.rb'
  # rubocop:disable Lint/UnusedMethodArgument
  def perform(wrapper, notification: false)
    wrapper.ingest_file
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
hyrax-5.0.1 app/jobs/ingest_job.rb
hyrax-5.0.0 app/jobs/ingest_job.rb
hyrax-5.0.0.rc3 app/jobs/ingest_job.rb
hyrax-5.0.0.rc2 app/jobs/ingest_job.rb
hyrax-5.0.0.rc1 app/jobs/ingest_job.rb
hyrax-3.6.0 app/jobs/ingest_job.rb
hyrax-4.0.0 app/jobs/ingest_job.rb
hyrax-4.0.0.rc3 app/jobs/ingest_job.rb
hyrax-4.0.0.rc2 app/jobs/ingest_job.rb
hyrax-4.0.0.rc1 app/jobs/ingest_job.rb
hyrax-3.5.0 app/jobs/ingest_job.rb
hyrax-4.0.0.beta2 app/jobs/ingest_job.rb
hyrax-3.4.2 app/jobs/ingest_job.rb
hyrax-4.0.0.beta1 app/jobs/ingest_job.rb
hyrax-3.4.1 app/jobs/ingest_job.rb
hyrax-3.4.0 app/jobs/ingest_job.rb
hyrax-3.3.0 app/jobs/ingest_job.rb
hyrax-3.2.0 app/jobs/ingest_job.rb
hyrax-3.1.0 app/jobs/ingest_job.rb
hyrax-3.0.2 app/jobs/ingest_job.rb