Class: ScheduleWorkers::GoogleReserve::MerchantFeedsWorker

Inherits:
ApplicationWorker
  • Object
show all
Includes:
ElasticAPM::SpanHelpers
Defined in:
app/workers/schedule_workers/google_reserve/merchant_feeds_worker.rb

Overview

MerchantFeedsWorker is a Sidekiq worker that delegates Google Reserve merchant feed generation to VendorsService::GoogleReserve::MerchantFeedsService

This worker serves as a thin wrapper around the service class to handle background job execution, while the actual business logic for generating Google Reserve merchant feeds is encapsulated in the service layer for better organization and testability.

Job Configuration

  • Queue: :critical (high priority processing)

  • Retry: 2 attempts on failure

  • Lock: :until_executed to prevent duplicate concurrent executions

  • Backtrace: enabled for better error debugging

Dependencies

  • VendorsService::GoogleReserve::MerchantFeedsService: Contains all business logic

  • AdminSetting.enable_reserve_with_google_feature: Feature flag for Google Reserve

Instance Method Summary collapse

Instance Method Details

#performvoid

This method returns an undefined value.

Main entry point for the merchant feed generation process Delegates to VendorsService::GoogleReserve::MerchantFeedsService

Raises:

  • (StandardError)

    Any unhandled errors are reported to APM



27
28
29
30
31
32
# File 'app/workers/schedule_workers/google_reserve/merchant_feeds_worker.rb', line 27

def perform
  return unless AdminSetting.enable_reserve_with_google_feature.to_s == true.to_s

  service = VendorsService::GoogleReserve::MerchantFeedsService.new
  service.generate_and_upload_feed
end