Sha256: 72c77579eb84f2b0b8363993a7de62f1d0b939115f5d4cf8df26009eba7fa283
Contents?: true
Size: 499 Bytes
Versions: 70
Compression:
Stored size: 499 Bytes
Contents
module ForemanRhCloud class InsightsStatusCleaner def clean(host_search) host_ids = Host.search_for(host_search).pluck(:id) # delete all insights status records for the hosts deleted_count = InsightsClientReportStatus.where(host_id: host_ids).delete_all # refresh global status Host.where(id: host_ids).preload(:host_statuses).find_in_batches do |hosts| hosts.each { |host| host.refresh_global_status! } end deleted_count end end end
Version data entries
70 entries across 70 versions & 1 rubygems