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-0.9.13.1 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-1.0.13.1 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-2.0.13.1 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-0.9.13 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-1.0.13 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-2.0.13 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-0.9.12 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-1.0.12 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-2.0.12 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-0.9.11 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-1.0.11 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-2.0.11 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-0.9.10 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-1.0.10 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-2.0.10 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-2.0.9 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-1.0.9 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-0.9.9 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-0.9.8 lib/foreman_inventory_upload/async/generate_all_reports_job.rb
foreman_rh_cloud-1.0.8 lib/foreman_inventory_upload/async/generate_all_reports_job.rb