diff options
author | Ikraam Ghoor <ikraamghoor@nebulab.it> | 2021-02-27 08:43:45 +0200 |
---|---|---|
committer | Ikraam Ghoor <ikraamghoor@nebulab.it> | 2021-03-26 10:59:28 +0200 |
commit | 28e9291ecdf010a4f87ee1cb8d2856d766ad0f75 (patch) | |
tree | 444e40b0f15bcdcac9a4bcba200f18fcbb39ed92 /lib/solidus_subscriptions/configuration.rb | |
parent | af29cabe832c06adef993057c03451a3859dcf84 (diff) |
Skip ActiveJob retrying for ProcessInstallmentJob
This disables the ActiveJob default retry mechanism because installment
processing failures are already taken care of by solidus_subscriptions.
Before this, there was a potentional for double retrying, which could
causes background jobs and cancelled orders to accumulate leading
to side effects such as a bad customer experience.
Now, a `process_job_error_handler` configuration Proc is called when a
ProcessInstallmentJob `#perfom` method fails.
The rescued error can be managed/logged as preffered, or re-raised
if the default retry behaviour is required in the job.
Diffstat (limited to 'lib/solidus_subscriptions/configuration.rb')
-rw-r--r-- | lib/solidus_subscriptions/configuration.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/solidus_subscriptions/configuration.rb b/lib/solidus_subscriptions/configuration.rb index 536aad3..6e4479d 100644 --- a/lib/solidus_subscriptions/configuration.rb +++ b/lib/solidus_subscriptions/configuration.rb @@ -11,7 +11,7 @@ module SolidusSubscriptions :success_dispatcher_class, :failure_dispatcher_class, :payment_failed_dispatcher_class, :out_of_stock_dispatcher, :maximum_successive_skips, :reprocessing_interval, :minimum_cancellation_notice, :processing_queue, :subscription_line_item_attributes, - :subscription_attributes, :subscribable_class, + :subscription_attributes, :subscribable_class, :process_job_error_handler, ) def success_dispatcher_class @@ -80,5 +80,9 @@ module SolidusSubscriptions def churn_buster? churn_buster_account_id.present? && churn_buster_api_key.present? end + + def process_job_error_handler + @process_job_error_handler ||= nil + end end end |