Sha256: 3baee84645f305440a237cd5cb170e69ce415414ff041f4e1bfccf7844610d30

Contents?: true

Size: 591 Bytes

Versions: 3

Compression:

Stored size: 591 Bytes

Contents

module Workarea
  module Orderbot
    module Product
      class ImportChildProducts
        include Sidekiq::Worker

        def perform
          Orderbot::ProductImportData.child_products.each do |child_product|
            result = begin
              Workarea::Orderbot::ChildProduct.new(child_product).process
            rescue StandardError => e
              child_product.update_attributes!(error_message: e.message)
              false
            end

            if result
              child_product.delete
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
workarea-orderbot-1.0.2 app/workers/workarea/orderbot/product/import_child_products.rb
workarea-orderbot-1.0.1 app/workers/workarea/orderbot/product/import_child_products.rb
workarea-orderbot-1.0.0 app/workers/workarea/orderbot/product/import_child_products.rb