Class: GoogleFeedGeneratorWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Job
Defined in:
app/workers/google_feed_generator_worker.rb

Overview

Runs the google feed generator async

Instance Method Summary collapse

Instance Method Details

#perform(options = {}) ⇒ Object

options:
catalog_ids: list of catalog id to focus on
catalog_item_ids: list of catalog item id to focus on



11
12
13
14
15
16
# File 'app/workers/google_feed_generator_worker.rb', line 11

def perform(options = {})
  catalog_ids = options['catalog_ids'].presence
  catalog_item_ids = options['catalog_item_ids'].presence
  catalogs = Catalog.where(id: catalog_ids) if catalog_ids.present?
  Feed::Google::ListGenerator.new.process(catalogs: catalogs, catalog_item_ids: catalog_item_ids)
end