Sha256: 29b3034adadf63de428f098f850978d1c002a31c389d01e4e78c807152b1aa64

Contents?: true

Size: 595 Bytes

Versions: 2

Compression:

Stored size: 595 Bytes

Contents

module InventorySync
  module Async
    class InventoryScheduledSync < ::Actions::EntryAction
      include ::Actions::RecurringAction

      def plan
        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

        Organization.unscoped.each do |org|
          plan_org_sync(org)
        end
      end

      def plan_org_sync(org)
        plan_action InventoryFullSync, org
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreman_rh_cloud-3.0.22 lib/inventory_sync/async/inventory_scheduled_sync.rb
foreman_rh_cloud-4.0.22 lib/inventory_sync/async/inventory_scheduled_sync.rb