Class: SolidusShipstation::Api::SyncShipmentsJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
app/jobs/solidus_shipstation/api/sync_shipments_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(shipments) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'app/jobs/solidus_shipstation/api/sync_shipments_job.rb', line 8

def perform(shipments)
  shipments = select_shipments(shipments)
  return if shipments.empty?

  sync_shipments(shipments)
rescue RateLimitedError => e
  self.class.set(wait: e.retry_in).perform_later
rescue StandardError => e
  SolidusShipstation.config.error_handler.call(e, {})
end