Sha256: 71ce1f3c2a2e7276e685fd76aeccb7346d47e57bc14e8c4dc9e94e5313d28c6f

Contents?: true

Size: 455 Bytes

Versions: 8

Compression:

Stored size: 455 Bytes

Contents

# frozen_string_literal: true
class EmbargoExpiryJob < Hyrax::ApplicationJob
  def perform
    records_with_expired_embargos.each do |id|
      work = ActiveFedora::Base.find(id)
      Hyrax::Actors::EmbargoActor.new(work).destroy
    end
  end

  ##
  # @return [Enumerator<String>] ids for all the objects that have expired active embargoes
  def records_with_expired_embargos
    Hyrax::EmbargoService.assets_with_expired_embargoes.map(&:id)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hyrax-2.9.6 app/jobs/embargo_expiry_job.rb
hyrax-2.9.5 app/jobs/embargo_expiry_job.rb
hyrax-3.0.0.pre.rc4 app/jobs/embargo_expiry_job.rb
hyrax-2.9.4 app/jobs/embargo_expiry_job.rb
hyrax-3.0.0.pre.rc3 app/jobs/embargo_expiry_job.rb
hyrax-2.9.3 app/jobs/embargo_expiry_job.rb
hyrax-2.9.2 app/jobs/embargo_expiry_job.rb
hyrax-2.9.1 app/jobs/embargo_expiry_job.rb