Sha256: 4381d4eb96c12064a6ef21323f7916fec8f9a66a69084e83889f956a79ac906b

Contents?: true

Size: 736 Bytes

Versions: 59

Compression:

Stored size: 736 Bytes

Contents

module InsightsCloud
  module Async
    class InsightsClientStatusAging < ::Actions::EntryAction
      include ::Actions::RecurringAction

      def run
        host_ids = InsightsClientReportStatus.stale.reporting.pluck(:host_id)

        # update all stale records
        InsightsClientReportStatus.where(host_id: host_ids).update_all(status: InsightsClientReportStatus::NO_REPORT)

        # refresh global status
        Host.where(id: host_ids).preload(:host_statuses).find_in_batches do |hosts|
          hosts.each { |host| host.refresh_global_status! }
        end
      end

      def logger
        action_logger
      end

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

Version data entries

59 entries across 59 versions & 1 rubygems

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