Class: Katello::Events::ImportPool

Inherits:
Object
  • Object
show all
Defined in:
app/models/katello/events/import_pool.rb

Constant Summary collapse

EVENT_TYPE =
'import_pool'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(pool_id) ⇒ ImportPool

Returns a new instance of ImportPool.



6
7
8
# File 'app/models/katello/events/import_pool.rb', line 6

def initialize(pool_id)
  @pool = ::Katello::Pool.find_by(:id => pool_id)
end

Instance Method Details

#runObject



10
11
12
13
14
# File 'app/models/katello/events/import_pool.rb', line 10

def run
  @pool.try(:import_data)
rescue RestClient::ResourceNotFound
  Rails.logger.warn "skipped re-index of non-existent pool #{@pool.cp_id}"
end