Class: InsightsCloud::Async::InsightsFullSync
  
  
  
  
    
      Instance Method Summary
      collapse
    
    
  
  
  
  
  
  
  
  
  
  
  #attempts_before_next_interval, #done!, #done?, #invoke_external_task, #poll_external_task, #poll_intervals
  
  
  
  
  
  
  
  
  
  
  
  #cert_auth_available?, #execute_cloud_request
  
  
  
  
  
  
  
  
  
  
  #candlepin_id_cert, #cp_owner_id, #upstream_owner
  
  
  
  
  
  
  
  
  
  
  #execute_cloud_request
  
  
  
    Instance Method Details
    
      
  
  
    #logger  ⇒ Object 
  
  
  
  
    
      
53
54
55 
     | 
    
      # File 'lib/insights_cloud/async/insights_full_sync.rb', line 53
def logger
  action_logger
end 
     | 
  
 
    
      
  
  
    
      
44
45
46
47
48
49
50
51 
     | 
    
      # File 'lib/insights_cloud/async/insights_full_sync.rb', line 44
def perform_hits_sync(organization)
  hits = query_insights_hits(organization)
  uuids = hits.map { |hit| hit['uuid'] }
  setup_host_ids(uuids, organization)
  replace_hits_data(hits, organization)
end
     | 
  
 
    
      
  
  
    #plan(organizations)  ⇒ Object 
  
  
  
  
    
      
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 
     | 
    
      # File 'lib/insights_cloud/async/insights_full_sync.rb', line 10
def plan(organizations)
  organizations = organizations.select do |organization|
    if cert_auth_available?(organization)
      true
    else
      logger.debug("Certificate is not available for org: #{organization.name}, skipping insights sync")
      false
    end
  end
  sequence do
            plan_hosts_sync(organizations)
    plan_self(organization_ids: organizations.map(&:id))
    concurrence do
      plan_rules_sync(organizations)
      plan_notifications
    end
  end
end
     | 
  
 
    
      
  
  
    #try_execute  ⇒ Object 
  
  
  
  
    
      
32
33
34
35
36
37
38
39
40
41
42 
     | 
    
      # File 'lib/insights_cloud/async/insights_full_sync.rb', line 32
def try_execute
  organizations.each do |organization|
    unless cert_auth_available?(organization)
      logger.debug("Certificate is not available for org: #{organization.name}, skipping insights sync")
      next
    end
    perform_hits_sync(organization)
  end
  done!
end
     |