Class: Workarea::IndexProduct

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::CallbacksWorker, Sidekiq::Worker
Defined in:
app/workers/workarea/index_product.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.perform(product) ⇒ Object



13
14
15
# File 'app/workers/workarea/index_product.rb', line 13

def perform(product)
  BulkIndexProducts.perform_by_model(product)
end

Instance Method Details

#perform(id) ⇒ Object



18
19
20
21
22
23
24
# File 'app/workers/workarea/index_product.rb', line 18

def perform(id)
  self.class.perform(Catalog::Product.find(id))
rescue Mongoid::Errors::DocumentNotFound
  Search::Storefront::Product.new(
    Catalog::Product.new(id: id)
  ).destroy
end