Sha256: d39595371634bcaea7432d559839340cfc65a95ded3bdf9ba01c5cf5fdefa837

Contents?: true

Size: 773 Bytes

Versions: 29

Compression:

Stored size: 773 Bytes

Contents

module InsightsCloud
  module Async
    class InsightsScheduledSync < ::Actions::EntryAction
      include ::Actions::RecurringAction
      include ForemanInventoryUpload::Async::DelayedStart

      def plan
        unless Setting[:allow_auto_insights_sync]
          logger.debug(
            'The scheduled process is disabled due to the "allow_auto_insights_sync"
            setting being set to false.'
          )
          return
        end

        after_delay do
          plan_full_sync
        end
      end

      def plan_full_sync
        plan_action(InsightsFullSync, Organization.unscoped.all)
      end

      def rescue_strategy_for_self
        Dynflow::Action::Rescue::Fail
      end

      def logger
        action_logger
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
foreman_rh_cloud-10.0.3 lib/insights_cloud/async/insights_scheduled_sync.rb
foreman_rh_cloud-11.0.3 lib/insights_cloud/async/insights_scheduled_sync.rb
foreman_rh_cloud-9.0.59 lib/insights_cloud/async/insights_scheduled_sync.rb
foreman_rh_cloud-11.0.2 lib/insights_cloud/async/insights_scheduled_sync.rb
foreman_rh_cloud-11.0.1 lib/insights_cloud/async/insights_scheduled_sync.rb
foreman_rh_cloud-11.0.0 lib/insights_cloud/async/insights_scheduled_sync.rb
foreman_rh_cloud-9.0.58 lib/insights_cloud/async/insights_scheduled_sync.rb
foreman_rh_cloud-10.0.2 lib/insights_cloud/async/insights_scheduled_sync.rb
foreman_rh_cloud-9.0.57 lib/insights_cloud/async/insights_scheduled_sync.rb
foreman_rh_cloud-10.0.1 lib/insights_cloud/async/insights_scheduled_sync.rb
foreman_rh_cloud-9.0.56 lib/insights_cloud/async/insights_scheduled_sync.rb
foreman_rh_cloud-9.0.55 lib/insights_cloud/async/insights_scheduled_sync.rb
foreman_rh_cloud-9.0.54 lib/insights_cloud/async/insights_scheduled_sync.rb
foreman_rh_cloud-9.0.53 lib/insights_cloud/async/insights_scheduled_sync.rb
foreman_rh_cloud-9.0.52 lib/insights_cloud/async/insights_scheduled_sync.rb
foreman_rh_cloud-8.0.52 lib/insights_cloud/async/insights_scheduled_sync.rb
foreman_rh_cloud-9.0.51 lib/insights_cloud/async/insights_scheduled_sync.rb
foreman_rh_cloud-8.0.51 lib/insights_cloud/async/insights_scheduled_sync.rb
foreman_rh_cloud-7.0.48 lib/insights_cloud/async/insights_scheduled_sync.rb
foreman_rh_cloud-7.0.47 lib/insights_cloud/async/insights_scheduled_sync.rb