Class: DeliveryShipConfirmWorker
- Inherits:
-
Object
- Object
- DeliveryShipConfirmWorker
- Includes:
- Sidekiq::Job
- Defined in:
- app/workers/delivery_ship_confirm_worker.rb
Overview
Sidekiq worker: delivery ship confirm.
Class Method Summary collapse
-
.lock_args(args) ⇒ Object
Extract delivery_id for unique lock key Note: NormalizeArgsMiddleware ensures args are string-keyed before lock computation.
Instance Method Summary collapse
-
#perform(options = {}) ⇒ Object
Note: NormalizeArgsMiddleware converts to HashWithIndifferentAccess.
Class Method Details
.lock_args(args) ⇒ Object
Extract delivery_id for unique lock key
Note: NormalizeArgsMiddleware ensures args are string-keyed before lock computation
16 17 18 19 |
# File 'app/workers/delivery_ship_confirm_worker.rb', line 16 def self.lock_args(args) = args.first || {} [['delivery_id']] end |
Instance Method Details
#perform(options = {}) ⇒ Object
Note: NormalizeArgsMiddleware converts to HashWithIndifferentAccess
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/workers/delivery_ship_confirm_worker.rb', line 23 def perform( = {}) delivery_id = [:delivery_id] @job_name = "Ship confirm for delivery id: #{delivery_id}" delivery = Delivery.find(delivery_id) if delivery.pending_ship_confirm? logger.info 'Delivery is pending ship confirm, calling delivery.individual_auto_ship_confirm' delivery.individual_auto_ship_confirm logger.info 'Finished auto ship confirm' else logger.info 'Delivery is not in ship confirm' end end |