Class: IntegrityCheckWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Job
Defined in:
app/workers/integrity_check_worker.rb

Overview

Periodic integrity check for critical database records.
Scheduled via Sidekiq scheduler to run regularly.

Checks:

  • ItemConstants::PROTECTED_SKUS exist in items table
  • ProductLineUrls.all_paths exist in product_lines table (slug_ltree)
  • PurchaseOrder::CARRIERS exist in suppliers table

Instance Method Summary collapse

Instance Method Details

#performObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/workers/integrity_check_worker.rb', line 12

def perform
  messages = []

  # Check protected SKUs
  messages.concat(check_protected_skus)

  # Check product line URLs
  messages.concat(check_product_line_urls)

  # Check carriers
  messages.concat(check_carriers)

  Mailer.admin_notification('Integrity Check Errors', messages.join("\n")) if messages.present?
end