Sha256: eb7f08c34a43d822c2457f60b358ca4af2bec03903038924cbda75d13fad5365
Contents?: true
Size: 727 Bytes
Versions: 32
Compression:
Stored size: 727 Bytes
Contents
# frozen_string_literal: true module Bulkrax class ScheduleRelationshipsJob < ApplicationJob def perform(importer_id:) importer = Importer.find(importer_id) pending_num = importer.entries.left_outer_joins(:latest_status) .where('bulkrax_statuses.status_message IS NULL ').count return reschedule(importer_id) unless pending_num.zero? importer.last_run.parents.each do |parent_id| CreateRelationshipsJob.perform_later(parent_identifier: parent_id, importer_run_id: importer.last_run.id) end end def reschedule(importer_id) ScheduleRelationshipsJob.set(wait: 5.minutes).perform_later(importer_id: importer_id) false end end end
Version data entries
32 entries across 32 versions & 1 rubygems