Class: ScheduleWorkers::GoogleReserve::MerchantFeedsWorker
- Inherits:
-
ApplicationWorker
- Object
- ApplicationWorker
- ScheduleWorkers::GoogleReserve::MerchantFeedsWorker
- 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
-
#perform ⇒ void
Main entry point for the merchant feed generation process Delegates to VendorsService::GoogleReserve::MerchantFeedsService.
Instance Method Details
#perform ⇒ void
This method returns an undefined value.
Main entry point for the merchant feed generation process Delegates to VendorsService::GoogleReserve::MerchantFeedsService
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 |