Sha256: 6da0a95b35b16fe9b51fac2bc8f2a448a1cd67ced37d7b2da94a719d245440da

Contents?: true

Size: 439 Bytes

Versions: 8

Compression:

Stored size: 439 Bytes

Contents

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

  ##
  # @return [Enumerator<String>] ids for all the objects that have expired active leases
  def records_with_expired_leases
    Hyrax::LeaseService.assets_with_expired_leases.map(&:id)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

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