Class: EdiProductDataFlowWorker
- Inherits:
-
Object
- Object
- EdiProductDataFlowWorker
- Includes:
- Sidekiq::Job
- Defined in:
- app/workers/edi_product_data_flow_worker.rb
Overview
Sidekiq worker: edi product data flow.
Constant Summary collapse
- DISPATCH_LOCK =
Constant.
'edi_product_data_flow_dispatch'
Instance Method Summary collapse
Instance Method Details
#perform(options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'app/workers/edi_product_data_flow_worker.rb', line 15 def perform( = {}) lock = ApplicationRecord.with_advisory_lock_result(DISPATCH_LOCK, timeout_seconds: 0) do dispatch() end return lock.result if lock.lock_was_acquired? Rails.event.notify('edi.product_data_flow', action: 'skipped', reason: 'dispatch_lock_held') nil end |