The catalog_push is one of the slowest actions. I would like it to add background processing for CatalogController#catalog_push, which should speed things up quite a bit.
I have pull request ready, but since the call is async I would need to use a callback providing import errors to an endpoint on the RetailOps side. Do you think that is feasible?
The job looks like this, and I would need to implement Spree::Api::Ratailops.import_results in this example:
class Spree::Retailops::CatalogJob < ActiveJob::Base
queue_as :default
attr_reader :params
def initialize
@params = {}
@diag = []
@memo = {}
@failed = {}
end
def perform(products, params = {})
@params = params
products.to_a.each { |pd| upsert_product_and_variants(pd) }
Spree::Api::Ratailops.import_results(@diag)
end
private
include Spree::Api::Retailops::CatalogHelpers
end
The catalog_push is one of the slowest actions. I would like it to add background processing for
CatalogController#catalog_push
, which should speed things up quite a bit.I have pull request ready, but since the call is async I would need to use a callback providing import errors to an endpoint on the RetailOps side. Do you think that is feasible?
The job looks like this, and I would need to implement
Spree::Api::Ratailops.import_results
in this example:CatalogController would add this line: