From 23b725d94d691323485c20c41cbf42c1665bccfc Mon Sep 17 00:00:00 2001 From: Paulo Felipe Silva de Souza Date: Fri, 22 Dec 2023 18:53:52 -0300 Subject: [PATCH] feat product_sync_job.rb: #7 add perform --- app/jobs/product_sync_job.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 app/jobs/product_sync_job.rb diff --git a/app/jobs/product_sync_job.rb b/app/jobs/product_sync_job.rb new file mode 100644 index 00000000..b4f058f2 --- /dev/null +++ b/app/jobs/product_sync_job.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class ProductSyncJob < ApplicationJob + queue_as :default + rescue_from(StandardError) do |exception| + Sentry.capture_message(exception) + end + + retry_on StandardError, wait: :exponentially_longer, attempts: 5 + + def perform(tenant, options = {}) + Product.synchronize_bling(tenant, options) + end +end