Class: InventoryRefresh::SaveInventory
- Inherits:
-
Object
- Object
- InventoryRefresh::SaveInventory
- Extended by:
- Logging
- Defined in:
- lib/inventory_refresh/save_inventory.rb
Class Method Summary collapse
-
.save_inventory(ems, inventory_collections) ⇒ Object
Saves the passed InventoryCollection objects.
-
.sweep_inactive_records(ems, inventory_collections, refresh_state) ⇒ Object
Sweeps inactive records based on :last_seen_at and :refresh_start timestamps.
Methods included from Logging
Class Method Details
.save_inventory(ems, inventory_collections) ⇒ Object
Saves the passed InventoryCollection objects
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/inventory_refresh/save_inventory.rb', line 14 def save_inventory(ems, inventory_collections) logger.debug("#{log_header(ems)} Scanning Inventory Collections...Start") InventoryRefresh::InventoryCollection::Scanner.scan!(inventory_collections) logger.debug("#{log_header(ems)} Scanning Inventory Collections...Complete") logger.info("#{log_header(ems)} Saving EMS Inventory...") InventoryRefresh::SaveCollection::TopologicalSort.save_collections(ems, inventory_collections) logger.info("#{log_header(ems)} Saving EMS Inventory...Complete") ems end |
.sweep_inactive_records(ems, inventory_collections, refresh_state) ⇒ Object
Sweeps inactive records based on :last_seen_at and :refresh_start timestamps. All records having :last_seen_at lower than :refresh_start or nil will be archived/deleted.
33 34 35 36 37 38 39 |
# File 'lib/inventory_refresh/save_inventory.rb', line 33 def sweep_inactive_records(ems, inventory_collections, refresh_state) logger.info("#{log_header(ems)} Sweeping EMS Inventory...") InventoryRefresh::SaveCollection::Sweeper.sweep(ems, inventory_collections, refresh_state) logger.info("#{log_header(ems)} Sweeping EMS Inventory...Complete") ems end |