Skip to content

Commit

Permalink
feat order_items_job.rb: task #32
Browse files Browse the repository at this point in the history
if items are already created, do not create twice.
Pauloparakleto committed Jan 5, 2024
1 parent 2388b4e commit 4b48256
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/jobs/order_items_job.rb
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@ class OrderItemsJob < ApplicationJob
retry_on StandardError, attempts: 20, wait: :exponentially_longer

def perform(record)
return unless record.items.empty?

account_id = record.account_id
items_attributes = []
order = Services::Bling::FindOrder.call(id: record.bling_order_id, order_command: 'find_order', tenant: account_id)

0 comments on commit 4b48256

Please sign in to comment.