Sha256: 7cfaef334a320d9dc0d020b8b84383441042a9117c3982bb9ca3497e2c501d64

Contents?: true

Size: 732 Bytes

Versions: 50

Compression:

Stored size: 732 Bytes

Contents

module ForemanInventoryUpload
  module Async
    class GenerateAllReportsJob < ::ApplicationJob
      def perform
        unless Setting[:allow_auto_inventory_upload]
          logger.debug(
            'The scheduled process is disabled due to the "allow_auto_inventory_upload"
            setting being set to false.'
          )
          return
        end

        organizations = Organization.unscoped.all

        organizations.map do |organization|
          GenerateReportJob.perform_later(ForemanInventoryUpload.generated_reports_folder, organization.id)
        end
      ensure
        self.class.set(:wait => 24.hours).perform_later
      end

      def self.singleton_job_name
        name
      end
    end
  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
foreman_rh_cloud-3.0.20 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-3.0.19 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-2.0.18.1 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-3.0.18.1 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-1.0.18 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-2.0.18 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-3.0.18 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-1.0.17 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-2.0.17 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-3.0.17 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-2.0.16 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-1.0.16 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-3.0.16 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-1.0.15 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-2.0.15 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-3.0.15 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-3.0.14 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-2.0.14 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-1.0.14 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-0.9.14 lib/foreman_inventory_upload/async/generate_all_reports_job.rb