Class: AmazonCatalogItemListingsDataWorker
- Inherits:
-
Object
- Object
- AmazonCatalogItemListingsDataWorker
- Includes:
- Sidekiq::Job, Workers::StatusBroadcastable
- Defined in:
- app/workers/amazon_catalog_item_listings_data_worker.rb
Overview
Sidekiq worker: amazon catalog item listings data.
Instance Attribute Summary
Attributes included from Workers::StatusBroadcastable
Instance Method Summary collapse
-
#perform(options = {}) ⇒ Object
Pulls Amazon Seller API listings data — catalog info, listing info, and the buy-box/pricing summary — for every Seller Central catalog, NA and EU.
Methods included from Workers::StatusBroadcastable::Overrides
Instance Method Details
#perform(options = {}) ⇒ Object
Pulls Amazon Seller API listings data — catalog info, listing info, and the
buy-box/pricing summary — for every Seller Central catalog, NA and EU.
EU was excluded until 2026-08-02, which left us blind there: no buy-box
status, no featured-merchant flag, and no CompetitivePriceThreshold. So
nothing could tell us a German listing was priced 19% above every sibling
EU marketplace until Amazon deactivated it under the Fair Pricing Policy.
This is the prerequisite for repricing the EU marketplaces: the repricer
acts on Amazon's reported reference, and we cannot act on a reference we
never collect. Read-only — it moves no prices on its own.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/workers/amazon_catalog_item_listings_data_worker.rb', line 32 def perform( = {}) [:catalog_ids] = CatalogConstants::AMAZON_SELLER_IDS if [:catalog_ids].blank? [:refresh_if_older_than] = 1.day.ago logger.debug("AmazonCatalogItemListingsDataWorker starting") start_time = Time.current result = Catalog::PullAmazonCatalogsListingsData.new.process() do |status| total status[:total] at status[:at], status[:message] # Log progress every 50 items if status[:at] % 50 == 0 elapsed = Time.current - start_time rate = status[:at] / elapsed * 60 # items per minute logger.info "Progress: #{status[:at]}/#{status[:total]} items (#{rate.round(1)}/min)" end end elapsed = Time.current - start_time logger.info "AmazonCatalogItemListingsDataWorker completed in #{elapsed.round(0)}s: #{result.catalog_items_updated.size} updated, #{result.catalog_items_failed.size} failed" store redirect_to: [:redirect_to] end |