Class: InventorySync::Async::InventoryScheduledSync
  
  
  
  
  
    - Inherits:
 
    - 
      Actions::EntryAction
      
        
          - Object
 
          
            - Actions::EntryAction
 
          
            - InventorySync::Async::InventoryScheduledSync
 
          
        
        show all
      
     
  
  
  
  
  
  
  
      - Includes:
 
      - Actions::RecurringAction, ForemanInventoryUpload::Async::DelayedStart
 
  
  
  
  
  
  
    - Defined in:
 
    - lib/inventory_sync/async/inventory_scheduled_sync.rb
 
  
  
 
  Constant Summary
  
  
  ForemanInventoryUpload::Async::DelayedStart::START_WINDOW
  
    
      Instance Method Summary
      collapse
    
    
  
  
  
  
  
  
  
  
  
  
  #after_delay, #humanized_name
  
  
  
  
    Instance Method Details
    
      
  
  
    #logger  ⇒ Object 
  
  
  
  
    
      
38
39
40 
     | 
    
      # File 'lib/inventory_sync/async/inventory_scheduled_sync.rb', line 38
def logger
  action_logger
end 
     | 
  
 
    
      
  
  
    #plan  ⇒ Object 
  
  
  
  
    
      
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 
     | 
    
      # File 'lib/inventory_sync/async/inventory_scheduled_sync.rb', line 7
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
  after_delay do
        concurrence do
      Organization.unscoped.each do |org|
        sequence do
          plan_org_sync(org)
          plan_remove_insights_hosts(org.id) if Setting[:allow_auto_insights_mismatch_delete]
        end
      end
    end
  end
end
     | 
  
 
    
      
  
  
    #plan_org_sync(org)  ⇒ Object 
  
  
  
  
    
      
29
30
31 
     | 
    
      # File 'lib/inventory_sync/async/inventory_scheduled_sync.rb', line 29
def plan_org_sync(org)
  plan_action InventoryFullSync, org
end 
     | 
  
 
    
      
  
  
    #plan_remove_insights_hosts(org_id)  ⇒ Object 
  
  
  
 
    
      
  
  
    #rescue_strategy_for_self  ⇒ Object 
  
  
  
  
    
      
42
43
44 
     | 
    
      # File 'lib/inventory_sync/async/inventory_scheduled_sync.rb', line 42
def rescue_strategy_for_self
  Dynflow::Action::Rescue::Fail
end 
     |