Class: AmazonPricingAutomationWorker
- Inherits:
-
Object
- Object
- AmazonPricingAutomationWorker
- Includes:
- Sidekiq::Job, Workers::StatusBroadcastable
- Defined in:
- app/workers/amazon_pricing_automation_worker.rb
Instance Attribute Summary
Attributes included from Workers::StatusBroadcastable
Instance Method Summary collapse
-
#perform(options = {}) ⇒ Object
Runs pricing automation for Amazon Seller Central US (76) and Canada (77) catalog items.
Methods included from Workers::StatusBroadcastable::Overrides
Instance Method Details
#perform(options = {}) ⇒ Object
Runs pricing automation for Amazon Seller Central US (76) and Canada (77) catalog items
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/workers/amazon_pricing_automation_worker.rb', line 10 def perform( = {}) = .symbolize_keys [:catalog_ids] = [CatalogConstants::AMAZON_SC_US_CATALOG_ID, CatalogConstants::AMAZON_SC_CA_CATALOG_ID] unless [:catalog_ids].present? result = Catalog::AmazonPricingAutomationService.new.process() do |status| at 0, "Processing catalog item #{status[:catalog_item].id} (#{status[:catalog_item].sku})" if status[:catalog_item] end logger.info "Amazon Pricing Automation completed: #{result.processed_count} processed, #{result.price_increased_count} prices increased, #{result.price_lowered_count} prices lowered, #{result.flagged_count} flagged" store redirect_to: [:redirect_to] end |