Class: Restaurants::GeneratePackageTagsWorker

Inherits:
ApplicationWorker show all
Includes:
ElasticAPM::SpanHelpers
Defined in:
app/workers/restaurants/generate_package_tags_worker.rb

Overview

Worker to generate package type tags for restaurants This worker ensures that restaurants are properly tagged with their available package types (e.g., “Offer:All You Can Eat”, “Offer:Party Pack”, etc.)

Why this worker exists:

  • Replaces deprecated .delay method from RestaurantCpt::Cell::DefaultSeo

  • Prevents duplicate job execution with sidekiq-unique-jobs

  • Provides proper monitoring and logging

Usage:

Restaurants::GeneratePackageTagsWorker.perform_async(restaurant_id)

Instance Method Summary collapse

Methods inherited from ApplicationWorker

unlimited_retry

Instance Method Details

#perform(restaurant_id) ⇒ Object



26
27
28
29
30
31
32
33
34
35
# File 'app/workers/restaurants/generate_package_tags_worker.rb', line 26

def perform(restaurant_id)
  RestaurantCpt::Cell::DefaultSeo.generate_package_types(restaurant_id)
rescue StandardError => e
  APMErrorHandler.report(
    'Failed to generate restaurant package tags',
    e: e,
    context: { restaurant_id: restaurant_id },
  )
  raise
end