From 4d242af007124fe75201ebff948067b8794449d7 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 25 Mar 2021 14:32:08 +1100 Subject: [PATCH] Use pessimistic locking processing Stripe payment We used pessimistic locking around the `update` action already but when Stripe redirects back to us we complete the payment in the `edit` action. --- app/controllers/checkout_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/checkout_controller.rb b/app/controllers/checkout_controller.rb index 1b8cd07d67..a1c69500bf 100644 --- a/app/controllers/checkout_controller.rb +++ b/app/controllers/checkout_controller.rb @@ -14,7 +14,7 @@ class CheckoutController < ::BaseController # We need pessimistic locking to avoid race conditions. # Otherwise we fail on duplicate indexes or end up with negative stock. - prepend_around_action CurrentOrderLocker, only: :update + prepend_around_action CurrentOrderLocker, only: [:edit, :update] prepend_before_action :check_hub_ready_for_checkout prepend_before_action :check_order_cycle_expiry